I have two table with single column. i.e Type and URL these are as
items
-----
image
image
image
video
items
-----
http://photo.com/some.jpg
http://photo.com/some1.jpg
http://photo.com/some2.jpg
http://video.com/some.avi
I want result as
Type URL
-----------------------------
image http://photo.com/some.jpg
image http://photo.com/some1.jpg
image http://photo.com/some2.jpg
video http://video.com/some.avi
how can i get result here type and url table have no primery key column
You can Find you solution Here
Below is the Detail
CREATE TABLE T1 (
items VARCHAR(10)
)
CREATE TABLE T2 (
items VARCHAR(100)
)
INSERT INTO T1
VALUES ('image'),('image'),('image'),('video')
INSERT INTO T2
VALUES ('http://photo.com/some.jpg'),('http://photo.com/some1.jpg'),('http://photo.com/some2.jpg'),('http://video.com/some.avi')
select TT1.t1_items as Type,TT2.t2_items as URL from
(select items t1_items,row_number() over(order by (SELECT 0)) as t1r from t1) as TT1,
(select items t2_items,row_number() over(order by (SELECT 0)) as t2r from t2) as TT2
where TT1.t1r = TT2.t2r
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With