What is the correct way to write an SQL Query so I can use the output of a function that I have used in the Select Statement in the Where clause?
Data Table:
ID Count_ID
111 2
111 2
222 3
222 3
222 3
333 1
Query:
Select ID, Count(Table1.ID) As Count_ID
From Table1
Where Count_ID = 3
Group By ID
It gives me invalid column name currently in there Where Clause for Count_ID.