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];
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
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
I did try that earlier, but my syntax must have been incorrect.