I am trying to get all blogs that are having their related sites been expired before a specific date blog is a table with foreign key for site (siteId) here my SQL code:
SELECT * FROM blog b
JOIN site s ON s.id=b.siteId
WHERE (s.expiryDate < '2021-03-01')
AND (b.plagiarismStatus=9 OR b.plagiarismStatus=1)
AND b.isDeleted=0 AND b.isClosed=1
I keep getting this error:
ERROR 1052 (23000) at line 1: Column 'id' in field list is ambiguous
any help will be too much appreciated