MySQL Forums
Forum List  »  Newbie

Run query, then follow-up query only if null return
Posted by: John Kholman
Date: October 29, 2017 09:23AM

I want to run a query like:
select LastReqTime,
BlockedOn,
UncommitOps
from sa_conn_info()
WHERE LastReqTime < DATEADD(mi,-10,GETDATE()) AND BlockedOn > 0

Then, if that query is null, possibly display a message and
run a second query:
select LastReqTime,
BlockedOn,
UncommitOps
from sa_conn_info()
WHERE BlockedOn > 0

I was attempting to use ROW_COUNT, but had no success. This *should* be very simple but Professor Google hasn't helped me find the answer even though I did find many instances of the same question on other forums. I finally decided I'd post my own query in this forum, where I'm guaranteed a good answer from the experts. Thanks in advance.

Options: ReplyQuote


Subject
Written By
Posted
Run query, then follow-up query only if null return
October 29, 2017 09:23AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.