0
我试图在MySQL中一次显示一个列名,但问题是它一直按字母顺序显示它们。我使用的语法是:按原始顺序显示列名称?
select column_name from information_schema.columns where table_schema =
'customer_info' and table_name='customer_contact' order by column_name LIMIT 1 OFFSET 0;
在customer_contact
表有三列这是cust_id
,cust_cell_num
和cust_email
。当我使用上面的语法时,它显示cust_cell_num
而不是cust_id
。
当改变的语法如下:
select column_name from information_schema.columns where table_schema =
'customer_info' and table_name='customer_contact' order by column_name LIMIT 3 OFFSET 0;
它显示按照以下顺序的列名:cust_cell_number
,cust_email
,cust_id
。
我怎样才能让它按照它们实际出现在数据库上的顺序显示它们:cust_id
,cust_email
,cust_cell_num
?
谢谢你,成功了! :d – Osiris93