var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Select clause
I there some way in which i can select from two tables simultaneously that have no common columns .
ie I have tables A and table B (Both have the same number of records)
I want to select all the records from table A frist , then the records from table B ..something like this :
name telno deptno location
xyz 534523 1 afadsf
abc 876776 2 sfasdkfa
SELECT a.name, a.telno, b.deptno, b.location from a,b ;
thanx for your reply.
But i dont know the columns of the particular tables.
I wanna select * from both tables.
Any more suggestions?
U can try out with this :
Select * from a,b
Yeah but the problem is that it will give me the cartesian product ..ie if there are 15 recs in A and 15 in B then it will return me 225 records...
Which is not what I am looking for ...
tell me exactly what do u expecting result from two tables.
I have clearly explained but here goes again ..I want concatenatoin ie
I have 2 recs in table A as follows :
I have 2 records in table B as follows :
Field1 Fiel2 Field3
x 5675 222
a 9789 998
I want my output as(there are no common fields in A&B)
1 abc x 5675 222
2 xyz a 9789 998
What you are asking for does not seem to make sense but hey. The only way I think it can be done is to create and populate a surogate key in each table and then join on that key.
eg create a column in each table called line_num which should be unique. Populated them from 1 to x. Then write a query to join the 2 tables on line_num (a.line_num = b.line_num).
Re: Select clause
I have fun solution for this problem :
select * from ( select rownum id_a , id from items order by id desc ) a , ( select rownum id_b , id from items2 ) b
where id_a = id_b
just add (+) if count of rows in not equal