February 22, 2014 at 9:57 am
Hi,
I am trying to cross join two tables which doesn't have any relation. Can anyone help me solve this. Here is my details.
http://www.imageurlhost.com/images/67spn200z5j1wpmzd9hz.png
Please let me know If I need to provide any details.
February 22, 2014 at 12:27 pm
images are blocked at work, but a cross join is pretty easy
SELECT T1. *, T2.*
FROM myTable T1
CROSS JOIN MyTable T2
Lowell
February 22, 2014 at 4:49 pm
Hi,
Try this
select t1.Transport,t2.[Order],t2.Size,t1.Service,
(select tx.Weight from Table1 tx where tx.type = 'Car') as Car,
(select tx.Weight from Table1 tx where tx.type = 'Bus') as Bus,
(select tx.Weight from Table1 tx where tx.type = 'USAirways') as USAirways,
(select tx.Weight from Table1 tx where tx.type = 'Lufthansa') as Lufthansa,
t2.Ratio
from Table1 t1
Cross join Table2 t2
Regards,
Igor
Igor Micev,My blog: www.igormicev.com
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply