小编isl*_*l65的帖子

如何查询varchar和int

我有这张桌子

name   | prof      |grade
------------------------
yossi   math     100
tami    math     70
yossi   phisic   100
tami    phisic   100
oren    math     100
oren    phisic   80
dor     history  70
Run Code Online (Sandbox Code Playgroud)

查询应返回数学和phisic等级为100的学生姓名正确的unswer是yossi我使用了以下内容

SELECT name FROM [dbo].[Class_grade]
where prof in ('math', 'phisic') and grade = 100
Run Code Online (Sandbox Code Playgroud)

但它返回更多的名字为什么?什么是正确的查询?谢谢

sql t-sql

0
推荐指数
1
解决办法
90
查看次数

标签 统计

sql ×1

t-sql ×1