SQL,您如何按字母顺序选取 Persons 表中 LastName 介于 Adams 和 Carter 的所有记录?
您的回答:SELECT*FROMPersonsWHERELastName>'Adams'ANDLastName<'Carter'正确答案:SELECT*FROMPerso...
您的回答:SELECT * FROM Persons WHERE LastName>'Adams' AND LastName<'Carter'
正确答案:SELECT * FROM Persons WHERE LastName BETWEEN 'Adams' AND 'Carter'
为什么?
那么SELECT * FROM Persons WHERE LastName>='Adams' AND LastName<='Carter'是对的吧?
介于 有包含之意? 展开
正确答案:SELECT * FROM Persons WHERE LastName BETWEEN 'Adams' AND 'Carter'
为什么?
那么SELECT * FROM Persons WHERE LastName>='Adams' AND LastName<='Carter'是对的吧?
介于 有包含之意? 展开
1个回答
展开全部
SELECT * FROM Persons WHERE LastName BETWEEN 'Adams' AND 'Carter'等于:
SELECT * FROM Persons WHERE LastName>='Adams' AND LastName<='Carter'
SQL
BETWEEN 操作符在 WHERE 子句中使用,作用是选取介于两个值之间的数据范围。
SELECT * FROM Persons WHERE LastName>='Adams' AND LastName<='Carter'
SQL
BETWEEN 操作符在 WHERE 子句中使用,作用是选取介于两个值之间的数据范围。
追问
SELECT * FROM Persons WHERE LastName>='Adams' AND LastName<='Carter'也行吧?
追答
对
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询