0
我有一個關於MYSQL If語句的問題。 我的要求:使用IF語句查詢
SELECT c.status, c.thumb, j.id, j.name, j.username, s.session_id, a.time, a.isactive, a.country, a.countrycode, a.city
FROM j16_users AS j
JOIN j16_community_users AS c ON c.userid = j.id
LEFT JOIN j16_session AS s ON s.userid = j.id
LEFT JOIN j16_session AS s ON s.userid = j.id
LEFT JOIN j16_x5_fastchat_users AS a ON a.userid = j.id
WHERE j.id IN (62,66,2692)
我如何添加一個新柱:有狀態isonline上述要求:
IF(a.time > DATE_SUB(NOW(), INTERVAL 1 MINUTE), "1", "0") AS isonline
謝謝!