Can you please help me out. I have this SQL query:
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
You seem to be selecting from the same table twice. Each of these occurrences needs its own alias:
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
Please note that I also added the missing alias l
for the links
table.