Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试查看标识列的值是否小于 1。
IF (SELECT PKIdent FROM dbo.MyTable WHERE PKIdent < 1) PRINT 'Its less than one'
这里有两种方法可以做到这一点:
IF ((SELECT min(PKIdent) FROM dbo.MyTable) < 1) PRINT 'Its less than one'
或者
IF exists (SELECT PKIdent FROM dbo.MyTable WHERE PKIdent < 1) PRINT 'Its less than one'