Software Testing

k2G9Eo9
RdZQRt6

Popular Posts

IN

IN()

The SQL IN condition is used to help reduce the need for multiple OR conditions in a SELECT, INSERT, UPDATE or DELETE statement.

The basic syntax is as follows.:
SELECT * FROM tables WHERE column IN (value1,value2,value3....);

Employee
Emp_idNameSurnameSalaryDept_id
1RajeshKhanna450002
2SnehaGupta550004
3SandeepNehte950001
4KirtiPatil250003
5NileshJadhav450003
6DipeshDas350005
7KailashRane620001
8KavitaDeshpande480003
9SanjayDatt500002
10ShrutiHasan780001
11SandeepDeshmukh520003

SQL Syntax:

SELECT * FROM Employee WHERE Dept_id IN ('1''2''4');
After Execution:
Emp_idNameSurnameSalaryDept_id
1RajeshKhanna450002
2SnehaGupta550004
3SandeepNehte950001
7KailashRane620001
9SanjayDatt500002
10ShrutiHasan780001

No comments:

Post a Comment