Re: JavaDB / Apache Derby equivalent to the SQL Server IsNull, Oracle nvl and MySQL IfNull
- From: James Appleby <james.w.appleby@xxxxxxxxx>
- Date: Tue, 14 Aug 2007 08:57:40 -0700
This is the DB I'm looking at. (Many tables and columns excluded for
simplicity.)
TASK {taskid}
PROCESSTASK {runid, taskid, processid, startstamp, stopstamp}
I have a number of tables representing tasks that can be run multiple
times. Tasks are made up of one or more processes. The table I am
querying on records the start and stop times of the processes. The
purpose is to get the count of currently running processes.
select sc.scriptid, nvl((select count(pt.runid)
from processtask pt
where pt.runid = <RUN_ID>
and pt.stopstamp is null
group by pt.taskid), 0)
from task tk where tk.taskid in (<TASK_IDS>)
.
- Follow-Ups:
- References:
- JavaDB / Apache Derby equivalent to the SQL Server IsNull, Oracle nvl and MySQL IfNull
- From: James Appleby
- Re: JavaDB / Apache Derby equivalent to the SQL Server IsNull, Oracle nvl and MySQL IfNull
- From: Thomas Kellerer
- Re: JavaDB / Apache Derby equivalent to the SQL Server IsNull, Oracle nvl and MySQL IfNull
- From: James Appleby
- Re: JavaDB / Apache Derby equivalent to the SQL Server IsNull, Oracle nvl and MySQL IfNull
- From: Thomas Kellerer
- JavaDB / Apache Derby equivalent to the SQL Server IsNull, Oracle nvl and MySQL IfNull
- Prev by Date: Re: jvm crash when using ojdbc1.4
- Next by Date: Re: JavaDB / Apache Derby equivalent to the SQL Server IsNull, Oracle nvl and MySQL IfNull
- Previous by thread: Re: JavaDB / Apache Derby equivalent to the SQL Server IsNull, Oracle nvl and MySQL IfNull
- Next by thread: Re: JavaDB / Apache Derby equivalent to the SQL Server IsNull, Oracle nvl and MySQL IfNull
- Index(es):