SELECT COUNT(packages.id) AS rowCount,
packages.packageCode
FROM packages
INNER JOIN prices ON packages.packageCode = prices.packageCode
WHERE TRUE packageCode LIKE '%EPOP%'
ORDER BY packageName ASC
where子句有错误,任何人都可以帮忙...
答案 0 :(得分:1)
只需更改where packages.packageCode
而不是packageCode
的子句,因为两个表中的packageCode
都会出现歧义错误,并从where子句中删除TRUE
个字。
SELECT COUNT(packages.id) AS rowCount,
packages.packageCode
FROM packages
INNER JOIN prices ON packages.packageCode = prices.packageCode
WHERE packages.packageCode LIKE '%EPOP%'
ORDER BY packages.packageName ASC