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.
| Author |
Topic |
|
rajeshkumar77
Starting Member
46 Posts |
Posted - 2002-02-17 : 06:30:29
|
| Dear Friends,In sql server, i have 2 tables called a and b.how can i retrieve the data from those 2 tables with single queryfor eg :Table : acolumnname : enoTable : bcolumnname : ename.how to retrive eno and ename from both the tables with single query.I heard that the query will be like this.select a.eno from a && b.ename from b;but this is not working with me.If anyone having idea, please tell me.thanks in advanceYoursRajesh |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2002-02-17 : 06:33:37
|
| How are the two tables connected?If they aren't then something likeselect eno, ename = convert(<datatype>,null) from aunionselect null, ename from b==========================================Cursors are useful if you don't know sql.Beer is not cold and it isn't fizzy. |
 |
|
|
azim
Starting Member
29 Posts |
Posted - 2002-02-17 : 06:45:17
|
| dear frindypu can do like thisselect students.studentid,emp.empid from students,empazim |
 |
|
|
rajeshkumar77
Starting Member
46 Posts |
Posted - 2002-02-17 : 06:51:16
|
Dear Friends,Thank you very much.Your replies helped me alot.Thanks again.YoursRajeshquote: dear frindypu can do like thisselect students.studentid,emp.empid from students,empazim
|
 |
|
|
Nazim
A custom title
1408 Posts |
Posted - 2002-02-17 : 07:26:20
|
| Rajesh ,if your tables have any keys in common then this should help you.select students.studentid,emp.empid from students join emp on empid.commonkey=students.commonkey--------------------------------------------------------------"Happiness is not something you experience, it's something you remember." |
 |
|
|
Arnold Fribble
Yak-finder General
1961 Posts |
Posted - 2002-02-17 : 08:01:13
|
| What's a com-monkey? How does it related to cow-orkers?(I also have difficulty with the shell item identifier type in the Windows API: SHITEMID)Edited by - Arnold Fribble on 02/17/2002 08:08:27 |
 |
|
|
|
|
|
|
|