What does “<>” mean in Oracle

前端 未结 10 2447
挽巷
挽巷 2020-12-30 19:46

What does <> mean in SQL language: Sample code is as follows

SELECT ordid,
       prodid,
       qty
FROM   item
WHERE  prodid IN (SELECT prodid
                  


        
10条回答
  •  再見小時候
    2020-12-30 20:29

    Does not equal. The opposite of =, equivalent to !=.

    Also, for everyone's info, this can return a non-zero number of rows. I see the OP has reformatted his question so it's a bit clearer, but as far as I can tell, this finds records where product ID is among those found in order #605, as is quantity, but it's not actually order #605. If order #605 contains 1 apple, 2 bananas and 3 crayons, #604 should match if it contains 2 apples (but not 3 dogs). It just won't match order #605. (And if ordid is unique, then it would find exact duplicates.)

提交回复
热议问题