comparison operator in count() is not working The query (SELECT 15 &gt; 14 FROM Duel) Working in MySql, but when I tried in MS-SQL Server getting following error:


  SQL Error(102): Incorrect syntax near '>'


I have a requirement where I want to see if at least 1 record exist return 1 or else 0

SELECT count(emp.name) &gt; 0
        FROM ****
        WHERE *** IN (***)


Check the db fiddle
I have a requirement where I want to see if at least 1 record exist return 1 or else 0  


You can do that with following query in MS-SQL (db-fiddle)

SELECT CASE WHEN count (*) &gt;= 1 THEN 1 ELSE 0 END
FROM new_table_name


Not sure how mySQL treats this SELECT 15 &gt; 14 FROM Duel, but in MS-SQL it's not complete statement (even columns exists with the name 15 and 14), operators (=, &lt;&gt;, !=, &gt;, &lt;, LIKE, IN, NOT IN) usually used in WHERE and ON clauses. When it used in SELECT clause it must complete the Boolean logic (CASE, IIF).