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
 Joins and Nulls

Author  Topic 

sridata
Starting Member

3 Posts

Posted - 2015-01-31 : 06:56:36
I have a small doubt regarding cross join and NULL values,please help if someone can..Table A has four rows (1,2,3,NULL)..Table B has 4 rows(1,2,3,NULL)..if i cross join table A and B..how many rows will be there in result

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-01-31 : 07:05:50
try it!
Go to Top of Page

sridata
Starting Member

3 Posts

Posted - 2015-01-31 : 07:24:32
no sql server instance here so not able to do..can u plz try and tell me..is there any cloud sql instance there
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-01-31 : 09:35:28
just install sql server express.

even better, if you've got 50 bucks, get a copy of Sql Server Developer.
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-01-31 : 09:38:32
fyi:


with
tablea(n) as (select 1 union select 2 union select 3 union select null),
tableb(n) as (select 1 union select 2 union select 3 union select null)
select * from tablea
cross join tableb


produces 16 rows, as expected. Cross join doesn't look at the data, It's just a cartesian product . 4 x 4 = 16, IIRC
Go to Top of Page

sridata
Starting Member

3 Posts

Posted - 2015-02-01 : 00:20:27
thanks a lot
Go to Top of Page
   

- Advertisement -