What does “<>” mean in Oracle

前端 未结 10 2440
挽巷
挽巷 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:26

    I'm surprised nobody mentioned the null special case. I think the meaning of <> is more something like

    has a value which is not equal to

    In this case it filters out items which have ordid 605 and items which have a null ordid.

    It may be obvious in this context that ordid is never null, but it is never hurts to remember that null is not <> from 605 (or from anything).

提交回复
热议问题