DEV Community

Nw3965
Nw3965

Posted on

Find Customer Referee

Find Customer Referee

I wanted to write SQL statements to get the information except "referee_id == 2" .

SELECT   referee_id  FROM Customer
EXCEPT  referee_id == 2
Enter fullscreen mode Exit fullscreen mode

I should select "name" to get the correct answer.

SELECT name FROM Customer
WHERE referee_id IS NULL OR referee_id <> 2;
Enter fullscreen mode Exit fullscreen mode

I learned <> is for not equal.

Top comments (0)