Thanks Dieter,
I couln't come up with the correct SQL. Thats the reason the first join was incomplete.
These is just only one case,
The value from the case should be
a, 1 if there an exact matching record where mst.dt1 = dat.dt and dat.ind = 1
b, if the above is not tru, then number of...
Thanks for the response.
You are absolutely right, I am trying to get the working days based on certain conditions.
This is my requirement. how do I extend your query to take care of all the three CASEs.
select mst.*,
case when mst.dt1 = dat.dt and dat.ind =1 then 1
case when dt1 < dt2...
I have another case where ,
when t1.col1 > t1.col2 then count( * ) from t2
else 0
it should be something like this
Select t1.col1 , t1.col2,
case when t1.col1 > t1.col2
then (select count(*) from t2 where t2.col1 between t1.col1 and t1.col2 and t2.col2 = 0)
else 0 end (BYTEINT)...
Thanks Dieter,
I am from the Oracle/DB2 bacground and thought of trying scalar sub queries before trying left outer join. Since, scalar doesn't work in this case, I should go with left outer join as you suggested.
I even tried, select col1, col2, (select count*) ..)
Again thanks for the...
Dear Group,
Teradata Version: V2R5
I have been trying to solve this problem for more than a day and everytime I get differenty error.
I want to update a certain table with count(*) of another table if certain condition is true, else update with 0.
This is the portion I have problem with...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.