我希望从db中选择两个以上的列,如何从这些列中选择一个不同的列。
样本查询
从
reports中选择id、name、intime、outtime、date;
在上面的查询中,我希望选择"id“作为区分。
发布于 2014-07-23 18:47:09
select id,name,intime,outtime,date
from reports
group by idmysql对组的扩展允许您选择不在group子句中的列。注意,对于group子句中未指定的列,服务器可以自由地从组中选择任何值。
发布于 2014-07-23 18:42:45
使用不同的?
select DISTINCT id,name,intime,outtime,date from reports;
https://stackoverflow.com/questions/24918398
复制相似问题