简体   繁体   中英

How do i select particular column from my table in sql

How do I select particular column from table,For example if i have 100 columns in my table and want only 20th-30th column to display . How it is possible in sql?

There is a way to select columns by their ordinal number in, for example, MySQL, but you should not be relying on these positions because they can change, and the order is not guaranteed.

The same holds true with regard to the location of rows (records) within your table.

Instead of

select * from table

use

select nameOfCol20, nameOfcol21, ..., nameOfCol30 from table

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM