Jump to content

[SOLVED] SELECT only rows whose keys can not be found in an another table


taps128

Recommended Posts

Hi, Im working on a database for a bakery.
I have one table which stores ingediends , and one table which stores recepies and the keys of the ingrediends which go in those recepies.
Now I dont want my users to change those ingredients which are allready used by some recepies, the easiest way to do it for me is not to show those ingredients on the change menu

I used this sql statement to do it

[code]SELECT distinct sirovine.sifra_sirovine as sifra_sirovine , sirovine.naziv_sirovine as naziv_sirovine FROM sirovine,recepti_sirovine WHERE sirovine.sifra_sirovine!=recepti_sirovine.sifra_sirovine ORDER BY sirovine.sifra_sirovine ASC[/code]

now, it doesn't work like it should. It still shows ingredients which are used in a recepie. Does any one how can I not show rows whiche have correltaitng data in one other table?

TIA
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.