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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 query

Author  Topic 

kt
Yak Posting Veteran

88 Posts

Posted - 2012-06-19 : 13:29:40
I have 2 tables.
tb1:
m_number cost
2 45
5 10

tb2:
m_number cost
2 40
5 10

I want to create query to find the diffrent cost b/2 those tbs.
can you help?


Thanks

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-06-19 : 13:42:10
SELECT A.Cost-B.Cost AS Diff
FROM tb1 A
INNER JOIN tb2 B ON A.m_number=B.m_number
Go to Top of Page
   

- Advertisement -