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
 General SQL Server Forums
 New to SQL Server Programming
 Inner join

Author  Topic 

day92
Starting Member

4 Posts

Posted - 2012-05-30 : 15:45:48
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

52326 Posts

Posted - 2012-05-30 : 15:48:32
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 - 2012-05-30 : 17:08:56
Got it. Thanks!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-05-30 : 17:11:49
welcome

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

Go to Top of Page
   

- Advertisement -