Friday, April 6, 2012

How show 10 cities for every city in a Single colum in a table

WITH TABL AS
(select row_number() over(partition by CITY order by CITY) row,city from address
where city in( select distinct city from address))
SELECT CITY FROM TABL WHERE ROW <11

No comments:

Post a Comment