Reputation: 33
Can you help me please? Trying to select those article numbers and pic paths that has the picture (some of them are without but it is not null). Is there some HAVING condition I can write? Or maybe just AND condition?
select a.artnr, p.path
from article a, photo p
where a.artnr = p.photo_nr
having ...and ...(?);
Upvotes: 0
Views: 893
Reputation: 10875
if you are looking for paths that are not empty, then you should do this:
select a.artnr, p.path
from article a
join photo p on a.artnr = p.artnr_nr
where p.path <> ''
If you have to do it in the very old school way using commas, which I agree with the comments that is not a good practice, then
select a.artnr, p.path
from article a, photo p
where a.artnr = p.artnr_nr
and p.path<>''
Upvotes: 1