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