Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a view from unrelated tables.

Status
Not open for further replies.

raven4

Vendor
Jan 10, 2008
32
0
0
US
I have Table A that contains: ID, Name
I have Table B that contains: RelationType

I want to be able to create a view that shows one row for each ID in Table A for each of the RelationTypes in Table B. So if there are three different RelationTypes, my results would be:

ID RelationType
100 Father
100 Mother
100 Mentor
200 Father
200 Mother
200 Mentor
300 Father
300 Mother
300 Mentor

Thanks.
 
Try this:

Code:
Select * From TableA Cross Join TableB

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top