Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

select * for one of two tables in a join

Status
Not open for further replies.

cronid

Computer
Apr 14, 2005
2
I have two tables, SMTR and CASE, which can easily be joined as below. I want a view which has all 10 columns of SMTR and the division column from CASE. I can get it by listing the 10 SMTR columns but I'd like to use an * for just SMTR, and specify the division column from CASE. Can this sql be modified to do that?

SELECT SMTR.Matter_NO, CASE.Division,
SMTR.Caption, SMTR.Versus,
SMTR.Matter_Category, SMTR.Matter_Type,
SMTR.Venue, SMTR.Index_No,
SMTR.Upload_Source,SMTR.Data_Source,
SMTR.Add_Date
FROM CASE, SMTR
WHERE SMTR.[Old_No]=CASE.[Case No];



 
Replies continue below

Recommended for you

Did you try

SELECT SMTR.*, CASE.Division
FROM SMTR, CASE
WEHRE SMTR.[Old_No]=CASE.[Case No]

The column order will different than your original statement, but the overall results set should be the same.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Thanks. That works.

I did try that earlier, but my syntax must have been incorrect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor