目前我有以下命令:
SELECT * FROM `clients`
WHERE `ID`=(SELECT `clientID`
FROM `websites`
WHERE `name` LIKE "%my name%")
LIMIT 0,20
我希望使用内连接,因为AFAIK应该如何处理。
我不知道怎么做......这就是我能想到的:
SELECT *
FROM `clients`
WHERE INNER JOIN `websites` ON `websites`.`name` LIKE "%lead%"
LIMIT 0,20
答案 0 :(得分:4)
SELECT c.* FROM `clients` c
INNER JOIN `websites` w ON w.clientID = c.ID
WHERE w.`name` LIKE '%lead%'
LIMIT 0,20