SQL queries a string of a specified length in a column. Redundant strings are represented by ellipsis

Time:2022-5-18

We often use GridView control, but sometimes, too much content is displayed, which can easily lead to page deformation and ugliness. Therefore, sometimes, in order to be beautiful, we only need to display the first few strings, and the rest can be represented by ellipsis. Here is a code for SQL intercepting strings, which can be taken away if necessary. Thank you

Select substring (column name, start, end) as column name from table

For example: substring (m_download, 0,20) as M_ download from Movie