Hi all!!
I have two tables
table1
C1
C2
C3
table2
C4
C5
C6
there is no unique column.
I want to get records corresponding to C2,C3 from table1 and C5 from table2
Which query i can use??
Loading
KarthikeyanPosted Sep 14, 2010, 8:50 PM
U can join information using the ID column
select T1.C2,T1.C3,T2.C5 from table1 T1,table T2 where T1.C1=T2.C4
gaurav bembiPosted Aug 31, 2010, 8:38 AM
thanks
Kiran NakhalePosted Aug 16, 2010, 2:50 AM
As there is no relation between two tables , in such case we can use cross join.
The query is as follow
SELECT Employee.FirstName, Employee.City, Demo.ZIP
FROM Employee CROSS JOIN
Demo
The o/p is as follows :-
Kiran Chandigharg 54646
Nehal R 54646
Priya D 54646
K Q 54646
Kiran Chandigharg 46546
Nehal R 46546
Priya D 46546
K Q 46546
Kiran Chandigharg 456456
Nehal R 456456
Priya D 456456
K Q 456456
Thanks,
Kiran
ShambhuPosted Aug 14, 2010, 9:44 AM
You can try these queries :
1. SELECT C2, C3, C5 FROM TABLE1, TABLE2
2. SELECT c2, c3, c5 from table1 cross join table2
Regards,
Shambhu
Gomathi PalaniswamyPosted Aug 10, 2010, 7:37 AM
am not understand your problem clearly.
use the below query to get data from two tables
SELECT column_name(s) FROM table_name1
UNION
SELECT column_name(s) FROM table_name2
With Regards,
Gomathi.P
Sam HobbsPosted Jul 21, 2010, 11:40 PM
If you want a simple join, then there are plenty of tools you can use to help you do that. You can use SQL Server or Access or Visual Studio. If you want help here, you need to at least be clear about what you need.
gaurav bembiPosted Jul 21, 2010, 3:06 AM
there are two tables
t1
columns:
ID
Name
City
t2
Columns
ID
ZIP
Now i need a table as end result having columns Name , City , ZIP
NOTE:- t1
ID Name City
1 Raj chd
2 Karan chd
3 Raj chd
t2
ID ZIP
1 12354
2 12354
3 12345
result should be
Raj chd 12354
Raj chd 12354
etc.....
Sam HobbsPosted Jul 21, 2010, 3:02 AM