Saturday 31 March 2012

How show 10 cities for every city in a city 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