sql语句,选择*,其中num大于1 [英] sql statement, select * where num greater than 1

查看:150
本文介绍了sql语句,选择*,其中num大于1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我想创建一个sql语句,如果它比访问数据库的字段小1,它将比较一个外部数字.选择*,其中num(大于1)大于a(整数),这是伪代码,如果有这样的代码,请提供帮助.

谢谢
Kyriakos

Hello,
I want to create an sql statement which will compare an external number if it is smaller to 1 than a field of an access database eg. select * where num (greater to 1) than a(integer), this was pseudo code, if there is such code please help.

Thank you
Kyriakos

推荐答案

如果等于1,则为true或false(例如,从表中选择*,其中num-(minus)a(var)= 1
true or false if equal to 1 (eg select * from table where num -(minus) a(var) = 1


SELECT *
FROM mytable
WHERE @num<1 AND mytable.a>@num


@num是您的外部号码的参数.
由于我无法完全理解这两种情况,因此您可能需要调整上面的语句,但要点是在WHERE子句中使用"AND".


@num is the parameter for your external number.
Since I failed to fully understand both conditions, you may need to adjust above statement, but the main point is to have an "AND" in the WHERE clause.


select

的情况 num> external_num
然后是"true"
否则为"false"
结束
从表


这将根据您的需要进行工作或调整
select
case when
num > external_num
then ''true''
else ''false''
end
from table


this will work or adjust is according to your need


这篇关于sql语句,选择*,其中num大于1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆