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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -