I am currently experimenting with using nested select statements but my subqueries are generating NULL values. What am I doing wrong?
SELECT filmid,datetime,title,description,
(
SELECT name
FROM fec_client
WHERE filmid = 'fec_film.filmid'
),
(
SELECT rating_motivation
FROM fec_rating_report
WHERE filmid = 'fec_film.filmid'
)
FROM fec_film
ORDER BY datetime DESC
remove the quotes, otherwise you are not comparing to the values in the SQL but to strings
p.s. you can also name those columns using the ‘AS’ keyword