I Have Three Table Here
First Table :
Second Table
Third table
I Have Update First Table Column OTD Like Query Here:
Update P Set OTD= (Select Case When max(DT)<= PD.DTWax Then 1 Else 0 End From PRCWax Where PRCNO=P.PRCNO Group By PD.PRCNO) From PRC As P Left Outer Join PRC_Day As PD ON PD.PRCNO=P.PRCNO
But Sql Error Here
Each GROUP BY expression must contain at least one column that is not an outer reference
How It possible
Thank in Advance