Hi all,
I have the following table:
Name2 : City1 : ...
Name3 : City1 : ...
Name1 : City2 : ...
Name5 : City1 : ...
...but now I would like to create one view of this table with by default only the name, and when there are two or more matches of a cname: name (cityname)
So:
Name1 (City2) : ...
Name2 : ...
Name3 : ...
Name5 : ...
I tried, but as you can see I don't know how to referernce ????
SELECT TOP 100 PERCENT
uname as Name,
Fullname = (select count(*) from database as x where x.uname = ????),
ucity as City
FROM database
I have the following table:
Code:
Name1 : City1 : ... Name2 : City1 : ...
Name3 : City1 : ...
Name1 : City2 : ...
Name5 : City1 : ...
Code:
...but now I would like to create one view of this table with by default only the name, and when there are two or more matches of a cname: name (cityname)
So:
Code:
Name1 (City1) : ... Name1 (City2) : ...
Name2 : ...
Name3 : ...
Name5 : ...
I tried, but as you can see I don't know how to referernce ????
Code:
SELECT TOP 100 PERCENT
uname as Name,
Fullname = (select count(*) from database as x where x.uname = ????),
ucity as City
FROM database