T-SQL

SQLServerCentral Article

Should I Type * or 1 With the EXISTS Logical Operator

  • Article

In my project I see that people writes different things with EXISTS logical operator (EXISTS (SELECT StarOrOne FROM...)). They are "*", "1" and even "TOP 1 1" or "TOP 1 *". The aim of this article to give a good explanation which option is the best.

4.59 (44)

You rated this post out of 5. Change rating

2020-01-24 (first published: )

14,824 reads

Blogs

Privacy Policy

By

We value your privacy. This policy explains what personal data we collect and why. What...

Why use XACT_ABORT?

By

This came up one day at my work when a developer was using it....

Using AI for Data Conversion

By

I’m sure I’ve never mentioned that I’m an amateur radio operator. Like Vegans and...

Read the latest Blogs

Forums

sp_lock memory leak

By TheRedneckDBA

I spotted this in the release notes for CU17 in SQL Server 2022: KB3616559...

Migration related issue

By LearningDBA

I migrated DB server from 2017 enterprise to 2019 enterprise. After the migration, every...

How Much AI Code Would You Use?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item How Much AI Code Would...

Visit the forum

Question of the Day

Browsing for Instances

I have a SQL Server instance that is not listening for connections on port 1433. By default, all ports are locked down on my server, except for the SQL Server port. What can I do to allow users to connect to the instance without knowing the port?

See possible answers