SQL Join and filter even further

0

I need to add a condition that only selects the rows where a field (my_galleries.format) equals a string value of ‘pictures’. I am trying to add it to this working sql statement.

SELECT
    gallery_url,
    preview_url
FROM
    my_galleries,
    my_gallery_previews  
WHERE
    my_galleries.gallery_id = my_gallery_previews.gallery_id

I tried this, with no luck….

SELECT
    gallery_url,
    preview_url 
FROM
    my_galleries,
    my_gallery_previews  
WHERE
    my_galleries.gallery_id = my_gallery_previews.gallery_id 
    AND my_galleries.format='pictures'

Any ideas?

Link: SQL Join and filter even further
Source: Stack Sql

Share.

About Author

Leave A Reply