0
To select records from a table who lives in same city which query/command will be used please answer me anyone fast.
6 Answers
+ 4
Check this maybe it can help
http://www.sqlservertutorial.net/sql-server-basics/sql-server-find-duplicates/
or try this:-
SELECT city_name, person_name, COUNT(city_name) FROM City GROUP BY city_name, person_name HAVING count(city_name) > 1;
+ 2
You can use GROUP BY query
+ 2
Disha Dey Group By will show alll the records if there is no duplicate value among the column.
If you want to get records of same city name then you have to pass the city name in where clause.
0
Group by showing all city not same city
0
But there are 3 same cities
0
Disha Dey Do order by city_name so it will show same cities records together.