You could use a stored procedure
SET TERM ^ ;
CREATE OR ALTER PROCEDURE CONSECUTIVE_DAYS (ipITEMNUMBER CHAR(3))
RETURNS (opDATEFROM DATE, opDATETO DATE, opCONSECUTIVEDAYS INTEGER)
AS
DECLARE VARIABLE vItem CHAR(3);
DECLARE VARIABLE vDate DATE;
BEGIN
opCONSECUTIVEDAYS = 0;
-- get latest
Den 02.03.2017 17:36, skrev 'Stef' s...@autotech.co.za [firebird-support]:
> Good day,
>
> I have a question for you SQL boffins, how can I query a table to get the
> count of consecutive days found ?
>
> A Table contains rows with dates where an item(s) has been added for every
> day this item was
Stef,
Will this work.
WITH CTE
AS (SELECT J0.*,
(SELECT COUNT(*)
FROM TEST_TABLE S1
WHERE S1.DATEUSED >= J0.START_DATE
AND S1.ITEMNR = J0.ITEMNR
AND S1.DATEUSED < J0.END_DATE) + 1 DAYS
FROM (SELECT DISTINCT
Hi
I noticed this (below) on a recent thread
* tweaking xinetd (flags = REUSE NODELAY)
I have a mainly real-time system with db response problems, does anyone
have experience of using NODELAY,