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 |
NamrataC
Starting Member
5 Posts |
Posted - 2009-09-09 : 02:41:42
|
Hi,I'm a novice to the query world.I'm trying to make a select query where I have to select 'rate' from table 'A' if the rate has not been changed in table 'B'. The table 'B' has code of table 'A' as foreign key.Someone please help me to make this query.Hoping for quick response. Thanking you in anticipation. |
|
ra.shinde
Posting Yak Master
103 Posts |
Posted - 2009-09-09 : 02:47:48
|
can you post table structure?Rahul Shinde |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-09-09 : 05:00:08
|
[code]select a.ratefrom tableA awhere exists ( select * from tableB b where b.code = a.code and b.rate = a.rate )ORselect a.code, a.ratefrom tableA a inner join tableB b on a.code = b.codewhere a.rate = b.rate[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
|
|
|