0

Hi all,

I have a very simple question, for many of you..

I need to write out a select list like this :

From table pages, I need id and link to fill up the options in my select list.

But I need to tjeck in another table, if there allready exists a matching key, and if there is, I need to NOT write out the id and link from the first table.

This is what I have, not working:

SELECT pages.id, pages.side_type, pages.link 
            JOIN module_image_galleri ON module_image_galleri.side_id != pages.id
            FROM pages
            WHERE pages.publiceret = 'ja' AND pages.url != '/' 
            ORDER BY pages.side_type, pages.placering ASC

So if there is a match between the two tables, I need to skip the id and link in my select.

What am I doing wrong and how can I do that..?

Best regards, Klemme

1
Contributor
1
Reply
15
Views
4 Years
Discussion Span
Last Post by klemme
0

Arh think i got it:

SELECT pages.id, pages.side_type, pages.link FROM pages 
            JOIN module_image_gallery ON module_image_gallery.side_id != pages.id               
            WHERE pages.publiceret = 'ja' AND pages.url != '/'
            ORDER BY pages.side_type, pages.placering ASC

Im hopeess at joins, but got it working..

Regards, Klemme

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.