如何编写SQL查询并在查询本身内部使用表达式 [英] How to write SQL query and use expressions inside the query itself

查看:125
本文介绍了如何编写SQL查询并在查询本身内部使用表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表名称为employee的字段名称为薪金.
我只想显示那些薪水是3的倍数的销售员.

请帮帮我.

预先谢谢您.

I have a table name employee, which have a field name salary.
I want to display only those employees salery, who earned salary that is multiple of 3.

Please help me.

Thank you in advance.

推荐答案

对于MSSQL:
For MSSQL :
select username,salery from employee where salery % 3 = 0


select empname,sal from employee where sal>0 and (sal % 3 = 0)


这篇关于如何编写SQL查询并在查询本身内部使用表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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