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
SELECT l.url from b inner join links as l on l.id = l.parent_id
inner join b as b1 on b1.link = l.id
where l.url like 'http:domain%' limit 0,30
In this query we r join two table first b and second links and self join b as b1 alias ok
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.