我下面的语句将返回表的所有结果,而不是仅返回匹配的n1。我附上了结果的截图。我期待的只是第一排。有人能帮我理解这里发生了什么吗?所附查询结果
Create View Proj_Display AS select * from Proj_d Where "n" in (Select Student from proj_d);
m1m5dgzv1#
Create View Proj_Display AS select * from Proj_d Where "n1" in (Select Student from proj_d);
您现在的查询检查表proj\d中是否存在值“n1”。这总是正确的。所以我猜你想要这样的东西:
Create View Proj_Display AS select * from Proj_d Where Student in (Select Student from proj_d WHERE Student = 'n1');
但您可以不使用子查询立即执行此操作:
Create View Proj_Display AS select * from Proj_d Where Student = 'n1'
但也许你需要提供更多你想要的信息
1条答案
按热度按时间m1m5dgzv1#
您现在的查询检查表proj\d中是否存在值“n1”。这总是正确的。所以我猜你想要这样的东西:
但您可以不使用子查询立即执行此操作:
但也许你需要提供更多你想要的信息