简体   繁体   English

用于显示记录的SQL查询

[英]SQL query for display of records

I'm fairly new to SQL. 我对SQL很新。 I want to write a query where I have to select and display all records where the integer value is not between 5000 and 12000. 我想编写一个查询,我必须选择并显示整数值不在5000到12000之间的所有记录。

试试这个,它为我工作

SELECT * FROM `mytable` WHERE price NOT BETWEEN 5000 AND 12000
select Number
from Table1
where Number < 5000
  or Number > 12000
SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN value1 AND value2;

SQL Between SQL之间

It would help to have table structures but this will give you everything but between those numbers. 这将有助于拥有表结构,但这将为您提供除这些数字之外的所有内容。

Where Int < 5000
AND Int > 12000

If you want to include those numbers 如果要包含这些数字

Where Int <= 5000
AND Int >= 12000

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM