creativejourney.com
creativejourney.com

Reputation: 155

SQL Server Cross Type Query

I have two simple tables. One of which has businesses and one has users. I want to create a query that returns all business Ids for each user. So my tables are like this:

Business

BusinessID

User

UserID

If I have three businesses and two users, I want to get six records back

BusinessID | UserID

1      |    1
2      |    1
3      |    1
1      |    2
2      |    2
3      |    2

I need something like a join without a join table. Please help and thanks ahead of time.

Upvotes: 0

Views: 138

Answers (1)

TcKs
TcKs

Reputation: 26632

SELECT B.BusinessID, U.UserID FROM tblBusiness AS B, tblUser AS U

Upvotes: 2

Related Questions