2011-06-03 212 views

回答

3

據我所知,你不能。您將不得不手動指定它們。

(見式兩份)

1

您的SELECT指定他們,但你可以通過做選擇的列清單(然後只能在dynamic SQL使用):

select column_name from information_schema.columns 
        where table_schema = database() 
         and table_name = 'mytesttable' 
         and column_name like 'icon_%' 
0
set @qry = (select concat('select ',group_concat(column_name), ' from ' ,table_name) from 
information_schema.columns 
where table_schema = database() 
and table_name = 'your_table_name' 
and column_name like 'icon_%'); 

prepare stmt from @qry; 
execute stmt; 
deallocate prepare stmt;