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 |
|
vallamreddy123
Starting Member
3 Posts |
Posted - 2008-02-27 : 01:31:10
|
| HiI just want to compare two columns of two tables in a single query.Actually i am new for sql server. can anybody help me in this issue.Thanks N Regards,Vallamreddy VenuGopal |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2008-02-27 : 01:36:35
|
| What sort of comparison do you want to make - for example , if they values are the same ? Jack Vamvas--------------------Search IT jobs from multiple sources- http://www.ITjobfeed.com |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-02-27 : 01:38:40
|
| Please post your table structures with some sample data & expected o/p |
 |
|
|
vallamreddy123
Starting Member
3 Posts |
Posted - 2008-02-27 : 01:49:09
|
Thank u Jack for ur reply.Yes the values are same. Both fileds are having same constraints.quote: Originally posted by jackv What sort of comparison do you want to make - for example , if they values are the same ? Jack Vamvas--------------------Search IT jobs from multiple sources- http://www.ITjobfeed.com
|
 |
|
|
vallamreddy123
Starting Member
3 Posts |
Posted - 2008-02-27 : 01:54:19
|
Hi,The table structure is like as below.First Table:AMName AMCOde -------------venu 1233 gopal 4563 sunil 7895 second table:AMName isactive------------------------venu 1gopal 0ramesh 1Now i want to comapre these two tables and i want to retreive only the AMNames whose active status is one from the first tablequote: Originally posted by visakh16 Please post your table structures with some sample data & expected o/p
|
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-02-27 : 02:06:11
|
| SELECT t1.*FROM FirstTable t1INNER JOIN SecondTable t2ON t2.AMName=t1.AMNameAND t2.isactive=1 |
 |
|
|
|
|
|