SQL Server 2000 中 exist关键字如何使用

2025-03-28 18:22:22
推荐回答(1个)
回答1:

应该是:

exists

//存在的意思

在sql里面的含义是:判断行是否存在!

select * from format where exists (select * from format where formatid=1)

如果存在formatid=1的这条记录,那么返回select * from format 所有的记录

如果不存在,那么什么都没有!

望好好学习,天天向上!