我对MySQL很新,我目前只想显示变量“活动”等于多个条目的数据:壁画,音乐会,剧院和博物馆。我该怎么做?
SELECT * FROM trail101 ORDER BY id DESC LIMIT 0, 9
你需要使用WHERE
条款。漫长的道路:
SELECT * FROM trail101 WHERE
activities = 'murals' OR
activities = 'concert' OR
activities = 'theater' OR
activities = 'museums'
ORDER BY id DESC LIMIT 0, 9
或者与IN
:
SELECT * FROM trail101
WHERE activities IN('murals', 'concert', 'theater', 'museums')
ORDER BY id DESC LIMIT 0, 9