如何编辑此mySQL查询以不选择2列中具有相同值的行?

时间:2016-03-31 09:42:10

标签: mysql

运行以下查询我收到以下消息

无效使用群组

SELECT COUNT( id ) AS pages,
       hash, MIN( DATE( TIMESTAMP ) ) AS FirstVisit, 
       MAX( DATE( TIMESTAMP ) ) AS LastVisit
       FROM behaviour
       WHERE MIN( DATE( TIMESTAMP ) ) != MAX( DATE( TIMESTAMP ) )
       GROUP BY hash

如何编辑此查询以便不显示FirstVisit等于LastVisit的行?

1 个答案:

答案 0 :(得分:0)

汇总函数SELECT * FROM tableName ORDER BY breaking_news DESC, news_published_dt ASC 其中can't be used in有`。

试试这个:

clause, but can be used in