+ 1
In and Or can be nested? Is this code is valid???
select* from employee where city in((' Bengalur' , 'Anantapur','Hindupur') or ('Vizag', ' Vijayawada' , ' Araku'));
3 odpowiedzi
+ 7
Either this:
SELECT * FROM employee
WHERE city
IN(' Bengalur' , 'Anantapur', 'Hindupur') OR city IN
('Vizag', ' Vijayawada' , ' Araku');
Or this:
SELECT * FROM employee
WHERE city
IN(' Bengalur' , 'Anantapur', 'Hindupur', 'Vizag', ' Vijayawada' , ' Araku');
+ 3
except you are searching for parameters with two different identities like salary and country.
E.g
SELECT * from employee WHERE salary IN('500', '2000', '50000') OR country IN ('Nigeria', 'Indonesia', 'Britain');
+ 2
DN HAMSAVENI its unnecessary because u could have put it all in the IN bracket and youd get your answer just fine