即时通讯我试图弄清楚如何在我的where子句中使用多于1行而不使用in()和any()因为我当前的数据库不支持这些功能。目前,我有这个查询MySQL的子查询返回多于1行WHERE子句
select crack_id
from gndmeas
where timestamp = (select distinct timestamp
from gndmeas
where site_id='agb'
order by timestamp desc limit 10
);
子查询包括
+---------------------+ | timestamp | +---------------------+ | 2017-01-13 08:15:00 | | 2017-01-10 07:00:00 | | 2017-01-06 08:30:00 | | 2017-01-03 10:00:00 | | 2016-12-27 09:25:00 | | 2016-12-20 07:30:00 | | 2016-12-13 07:35:00 | | 2016-12-09 08:10:00 | | 2016-12-06 07:40:00 | | 2016-12-02 07:00:00 | +---------------------+
,我想对where子句做与数据的选择查询。是否有可能在不使用mysql的any()和in()函数的情况下执行?
在此先感谢。
您可以使用加入 –
你可以尝试使用'EXISTS'。 –