×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

select * for one of two tables in a join

select * for one of two tables in a join

select * for one of two tables in a join

(OP)
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];



RE: select * for one of two tables in a join

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

RE: select * for one of two tables in a join

(OP)
Thanks. That works.

I did try that earlier, but my syntax must have been incorrect.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources