我想按日期排序显示日志到最近活动页面。现在,我试图执行此以我的MySQL选择多个表并按datetime列排序显示它们
"SELECT * FROM tracking_log.editlog, tracking_log.deletelog, tracking_log.loginlog, tracking_log.logoutlog ORDER BY time ASC";
,但它总是说 Column 'time' in order clause is ambiguous
所有的表有一个时间列,以日期时间格式(0000-00-00 00:00 :00)
我该如何取它们按时间排序?
在此先感谢!
指定下'time'属于你的表名。 'ORDER BY tableName.time ASC' – 1000111
“如果某列不明确,则意味着查询中的多个表有一个具有该名称的列。” (с)http://stackoverflow.com/questions/25721307/error-code-1052-column-datetime-in-where-clause-is-ambiguous – IceJOKER
所有这些表都有时间栏。我想从4个表格中提取所有这些数据并按时间排序。我怎么做? – technoken