I am looking for an answer, where from a column (table of about 50 thousand records) I just need to check if the column has at least two different values.
Select Count(Distinct ColumnA) from tableX
The above query gives me the result, but it is not optimized, since I just want to get an answer in Boolean
i.e. Count Greater than 1 or Not?
In addition, increasing the number of records in table X will degrade query performance, I am looking for something that does not depend on the number of records in the table. Any help is appreciated :) thanks.
source share