Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
sno Name1 Name2 Data
-----------------------
1 Jai Jai 20
2 mani mani 30
3 kumar ganesh 40
4 siva kumar 50
5 sai sai 60

SQL Query is = Select Count(*) as countt from tablename where (Name1 == Name2)

i thing this is my own query this s wrong one.


i want the output is :

Countt
------
3
Posted

Try This
SQL
Select Count(*) as countt from tablename where Name1 = Name2
 
Share this answer
 
Hello ,
Just use single "=" instead of double "=" . You will get required out put .
 
Share this answer
 
SQL doesn't use "==" - try "=" instead;
SQL
SELECT COUNT(*) FROM tablename WHERE Name1 = Name2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900