指甲漫画恐怖全集:sql中取数据库最大数

来源:百度文库 编辑:高校问答 时间:2024/04/27 19:02:31
表单提交

a 和 b

if a<>"" and b<>"" then

筛选数据库某字段中,从a到b

elseif a<>"" and b="" then

筛选数据库某字段中,从a到最大数

elseif a="" and b<>"" then

筛选数据库某字段中,从最小数到b

end if

sqlserver吗?
if a <> "" and b <> ""
select * from 表名 where 字段 between a and b
else
if a <> ""
select * from 表名 where 字段 >= a
else
select * from 表名 where 字段 <= a