I have the following working sql sequence:
SELECT *, films.category AS filmCategory
FROM ( SELECT *
FROM films
ORDER BY `unique` ASC
LIMIT 6, 4) films
LEFT OUTER JOIN items ON items.unique = films.ref
ORDER BY films.unique ASC
This works well and selects the correct four elements from the DB. However, I have some rules that I check for using WHERE
, that I can't get working. I have done the following:
SELECT *, films.category AS filmCategory
FROM ( SELECT *
FROM films
ORDER BY `unique` ASC
LIMIT 6, 4) films
LEFT OUTER JOIN items ON items.unique = films.ref
WHERE films.youtube IS NOT NULL AND films.youtube <> ''
ORDER BY films.unique ASC
where the only difference is the added line with the WHERE
clause. But this doesn't work - in fact it makes no difference from before but returns the same rows.
How can I include these WHERE
rules correctly in this sql sentence?
Note
The line films.youtube IS NOT NULL AND films.youtube <> ''
is checking if a specific cell is empty. This is made with help from this question