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 |
|
manshafmkd
Starting Member
3 Posts |
Posted - 2012-05-26 : 04:45:04
|
| how select the unique column names from 4 tablesi using the code select *from t1where exists(select * from t2 where t2.col1 = t1.col1 and t2.col1 = t1.col1)but its only for two table connection i want four table connection Please give a help |
|
|
slimt_slimt
Aged Yak Warrior
746 Posts |
Posted - 2012-05-26 : 16:22:07
|
Please be so kind and provide additional explanation what you want to achieve. if you want all the names from 4 tables, just list the name of columns. eg.:selecttable1.column1,table1.column2,table2.column1,table2.column3,table3.column4,table4.column1from table1 join table2on table1.column1 = table2.column1join table3on table1.column1 = table3.column1 |
 |
|
|
manshafmkd
Starting Member
3 Posts |
Posted - 2012-05-27 : 02:50:59
|
Actually i have a unique column in all table ,if i enter the unique column value to show the related table unique column value statusquote: Originally posted by slimt_slimt Please be so kind and provide additional explanation what you want to achieve. if you want all the names from 4 tables, just list the name of columns. eg.:selecttable1.column1,table1.column2,table2.column1,table2.column3,table3.column4,table4.column1from table1 join table2on table1.column1 = table2.column1join table3on table1.column1 = table3.column1
|
 |
|
|
manshafmkd
Starting Member
3 Posts |
Posted - 2012-05-27 : 03:36:22
|
| select *from tb_apartmentrentwhere exists(select * from tb_renovteapprt where tb_renovteapprt.orderid = tb_apartmentrent.orderid and tb_renovteapprt.orderid = tb_apartmentrent.orderid)this is my query actually i have toatal 5 tables the tables aretb_apartment,tb_renovteapprt,cancelappartment,tb_completeapartment,tb_validateapartmenteach table have a unique colum name orderidi want to check the orderid renovated,canceled,completed and validated but my query only the relation betweeb two tables ,but i need the relation between 5 tables Please give me the solution |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|
|
|
|