Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

cross join query

$
0
0
Hi there, i would like to get help writing a cross join query with one table: Cities(City_name, X_coordinate, Y_coordinate)the result should be all combinations without reverse column returnsSELECT * FROM [dbo].[Cities] as P1Cross JOIN [dbo].[cities] as p2where (p1.City_name != p2.City_name) and ???for example if there are three Cities as A,B,C the result should be: A->B, A->C, B->C (without the returns B->A, C->A, C->B)thanks,Ben

Viewing all articles
Browse latest Browse all 3145

Trending Articles