Difference between In and where In SQL and between sqlinwhere
The meaning of In and Where In SQL statements is different.
The application is explained as follows:
1. If you need to select, delete, and update data from a table with conditions, use Where;
2. In is only used as an operator under the Where Condition Clause. Besides In, there are also Between, Like, =,>,> =, <, <=, and other operators.
The following is an example:
1. If you query A and B students, the statement is
Select * from student where name in ('A', 'B ');
........................................ ........................................ .......................................
The where clause is followed by a conditional expression, indicating that the result meeting this condition is to be found.
In is a subquery or a given value.
For example, select * from student where Sname = 'zhang san';/* query the information of a student named Zhang San */
Select * from student where Sname in ('zhang san', 'Li si');/* query the student information of Zhang Sanhe and Li Si */
Select * from student where Sname in (select Sname from sn where Sno = '001');/* query the student information whose student ID is 001 */