SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Inner join
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

day92
Starting Member

4 Posts

Posted - 05/30/2012 :  15:45:48  Show Profile  Reply with Quote
Hi guys I have a sql query Im trying to run. I want to inner join two tables where the last name is = to 'cashie' from one table and I only want the 'mod' column from the 2nd table. They both have unique inv_num.
Below is the query im trying to run but Im stuck on how to get the 'mod' data in there from the 2nd table.

select * from dbo.CM_CalculatedRVUs
where provider like'Cashie%'
INNER JOIN dbo.DBMSBARBTXNLIPAY
ON inv_num

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 05/30/2012 :  15:48:32  Show Profile  Reply with Quote
you should have looked up syntax for INNER JOIN in books online.

it should be


select * from dbo.CM_CalculatedRVUs c
INNER JOIN dbo.DBMSBARBTXNLIPAY d
ON d.inv_num = c.inv_num
where <c|d>.provider like'Cashie%'


I dunno which table provider column comes from so make sure you put correct alias there

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

day92
Starting Member

4 Posts

Posted - 05/30/2012 :  17:08:56  Show Profile  Reply with Quote
Got it. Thanks!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 05/30/2012 :  17:11:49  Show Profile  Reply with Quote
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000