I want to write a SQL query like the following. Its syntax is not correct. How can I correct it?
$sql_package_feature = "SELECT f.feature_id, f.feature_name FROM tbl_feature f
LEFT JOIN SELECT * FROM tbl_feature_and_profile fp WHERE fp.profile_id= ? ) ON
f.feature_id = fp.feature_id AND f.package_id = fp.package_id WHERE fp.feature_id
IS NULL AND f.package_id = ? ORDER BY f.feature_id";
I think it was abount missing ‘as fp’ after subselect. Try this query: