Finding Data

  • Please help,

    I have a table "plate" (plateId, plateName), I want to find out what plate does not exist in the table from the four values wich are constants 'Cyan', 'Magenta', 'Black', 'Yellow' These values are not stored in a database just constants to be declared in the SP.

    Example is the table has Cyan, Magenta the result should be Black and Yellow.

    Hope that is clear.

    Thank you in advance.

    Lamine

  • If this is an assignment question, you've basically got one possible answer written down right here, but it's in natural English instead of the less natural English(-ish) of SQL.

    I want to find out what plate does not exist in the table from the four values ... 'Cyan', 'Magenta', 'Black', 'Yellow'

    "does not exist" = "where not exists(...)"

    "in the table" = "select ... from table"

    Four constants = "a set of four constants" = "in (c1, c2, c3, c4)"

    There are many other ways of expressing this, some will be faster than others, and logical simplifications of what you have already written, but this should help you get to one solution, and you can simplify from there.

  • What have you tried so far? Also, for better help with your problems, please take the time to read and follow the instructions you will find in the first article I have referenced below in my signature block regarding asking for help.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply