How to use If statements in SQL? -
i trying create if statement in sql, possible?
if start2 >= start1 , start2 <= end1, group_start=start1 (else start2) if end2 >=end1, group_end=end2 (else end1)
not clear trying do, use case-statements this. try below code , see if after.
select case when start2 >= start1 , start2 <= end1 start1 else start2 end group_start ,case when end2 >= end1 end2 else end1 end group_end ...
Comments
Post a Comment