Select S.ID,Sum(S.cost),R.MyDate
from S as table1,R as table2
Group by ID
where S.ID=R.ID and myDate<=D2 and myDate>=D2
Hi,some questions:
1. What are those aliiase for? you set alias for S and R but never used them.maybe you meant:
table1 as S,table2 as R
2.The syntax is wrong due to preceding group by before where clause.
3.This is a simple join.I recommand using ANSI-92 compatible syntax as:
S inner join R on S.ID = R.ID for that purpose.
4. myDate<=D2 and myDate>=D2
Do you mean MyDate = D2? Does D2 hard coded or is a bind variable or...?
5.A hint for all seasons: Send your DDL to create your test scenario so we can reply you more consciously !
I think main problem (Ya,this is very frequent on forums! ) is how to select anothre not-in-group by column (here R.MyDate) among the other columns.
I am looking for your DDLs and then...
-Best wishes and feel free to mail me: [email]baronc_rampantc@yahoo.ca[/email
]