你能帮我一下吗?我有这个SQL查询:
SELECT l.url FROM (b INNER JOIN links ON b.parent_id = l.id) INNER JOIN b ON l.id = b.link WHERE l.url LIKE 'http://domain%' LIMIT 0, 30
它以某种方式说
#1066 - Not unique table/alias: b
您似乎从同一张表中选择了两次。这些事件中的每一个都需要有自己的别名:
SELECT l.url FROM b as b1 /* <-- */ INNER JOIN links as l ON b1.parent_id = l.id INNER JOIN b as b2 /* <-- */ ON l.id = b2.link WHERE l.url LIKE 'http://domain%' LIMIT 0, 30
请注意,我还l为该links表添加了缺少的别名。
l
links