如何从范围为55 - 42000的column_a
中选择表格。
注意:column_a
的数据类型位于nvarchar
我试过这样,但没有运气
SELECT
SoftwareName, SoftwareImageTeaser, SoftwarePrice, SoftwareDescription
FROM
View_Software_Listing_With_Category
WHERE
(SoftwarePrice >= '55' AND SoftwarePrice <= '42000')
答案 0 :(得分:2)
SELECT SoftwareName,SoftwareImageTeaser,SoftwarePrice,SoftwareDescription
FROM View_Software_Listing_With_Category
WHERE (CAST(CAST(SoftwarePrice AS FLOAT) AS INT) BETWEEN 55 AND 42000
答案 1 :(得分:1)
试试这个,因为你的SoftwarePrice
列是nvarchar,你需要在整数中转换它以与整数值进行比较。然后,您可以使用between
子句来过滤记录。
SELECT SoftwareName,SoftwareImageTeaser,SoftwarePrice,SoftwareDescription
FROM View_Software_Listing_With_Category
WHERE Cast(SoftwarePrice as Int) between 55 AND 42000