我有:
SELECT * FROM '.PRFX.'sell
WHERE draft = "0" AND id
IN ( SELECT id_ FROM '.PRFX.'skipped
WHERE uid = "'.$u.'" )
我想从ID field (DESC)
'.PRFX.'skipped'
订购
怎么做?
答案 0 :(得分:0)
您可以使用左连接:
SELECT DISTINCT *
FROM '.PRFX.'sell sell
JOIN '.PRFX.'skipped skip ON skip.id_ = sell.id
WHERE draft = "0" AND skip.uid = "'.$u.'"
ORDER BY skip.id DESC