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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.