Interval range and set operator - in the query

/ *
Interval range and set operators

Interval range:
BETWEEN xx and yy: [xx, yy]
Not BETWEEN xx and yy: yy is greater than or less than xx

Collection range:
in (list of values)
not in (list of values)

*/

# Inquiry salary equal to 10000 and less than or equal greater than 15,000 employees
the SELECT * the FROM t_employee
the WHERE 15,000 salary the BETWEEN the AND 10000;

# Query a native of "Zhejiang", "Beijing", "Shanghai", "Heilongjiang" employees
the SELECT * the FROM t_employee
the WHERE native_place the IN ( 'Zhejiang Province', 'Shanghai', 'Beijing', 'Heilongjiang');

# Inquiry is not a native of the "Zhejiang", "Beijing", "Shanghai", "Heilongjiang" employees
the SELECT * the FROM t_employee
the WHERE native_place the NOT the IN ( 'Zhejiang Province', 'Shanghai', 'Beijing', 'Heilongjiang');

Published 230 original articles · won praise 17 · views 6979

Guess you like

Origin blog.csdn.net/weixin_44050355/article/details/103949660