Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 FULL combine

Author  Topic 

Johnph
Posting Yak Master

103 Posts

Posted - 2013-06-05 : 15:55:49
I have two tables that looks like this:

COL1
1
2
3
4
5
6


COL2
A
B
C


I need this result:
COL1 COL2
1 A
1 B
1 C
2 A
2 B
2 C
3 A
3 B
3 C
4 A
4 B
4 C
5 A
5 B
5 C

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-06-05 : 17:29:16
[code]SELECT a.COL1, b.COL2 FROM TableA a CROSS JOIN TableB B
ORDER BY a.COL1, b.COL2[/code]
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2013-06-05 : 19:45:14
WHERE Col1 < 6

=================================================
May my silences become more accurate. -Theodore Roethke (1908-1963)
Go to Top of Page
   

- Advertisement -