Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephane Crozat
apisub
Commits
bf1bf423
Commit
bf1bf423
authored
Feb 07, 2019
by
Stephane Crozat
Browse files
fix bug nombre de demandes excluant les demandes invalidées
parent
a6fe503e
Changes
2
Hide whitespace changes
Inline
Side-by-side
sql/apisub_dataset.sql
View file @
bf1bf423
...
...
@@ -108,7 +108,7 @@ INSERT INTO subscribe (utclogin,api,subdate) VALUES (
);
SELECT
normcode
,
name
,
size
,
nbval
,
nbask
,
nbsub
,
open
,
resplogin
,
semester
,
year
FROM
vapi
;
SELECT
normcode
,
name
,
size
,
nbval
,
nbask
,
open
,
resplogin
,
semester
,
year
FROM
vapi
;
SELECT
*
FROM
vlocaluser
;
SELECT
utclogin
,
id
,
normcode
,
validation
FROM
vsubscription
;
...
...
sql/apisub_views.sql
View file @
bf1bf423
...
...
@@ -5,6 +5,7 @@ SELECT
api
AS
subcountid
,
COUNT
(
utclogin
)
AS
countsub
FROM
subscribe
WHERE
validation
IS
NULL
GROUP
BY
api
;
CREATE
OR
REPLACE
VIEW
vapi_valcount
AS
...
...
@@ -24,9 +25,8 @@ TO_CHAR(dbegin + duration-1,'TMday FMDD TMmonth') AS normdend,
TO_CHAR
(
dbegin
,
'IW'
)
AS
week
,
TO_CHAR
(
dbegin
,
'yyyy'
)
AS
year
,
semester
(
dbegin
)
AS
semester
,
COALESCE
(
countsub
,
0
)
AS
nb
sub
,
COALESCE
(
countsub
,
0
)
AS
nb
ask
,
COALESCE
(
countval
,
0
)
AS
nbval
,
COALESCE
(
countsub
,
0
)
-
COALESCE
(
countval
,
0
)
AS
nbask
,
CASE
WHEN
countval
>=
size
THEN
0
ELSE
1
END
AS
open
FROM
api
LEFT
JOIN
vapi_subcount
ON
id
=
subcountid
LEFT
JOIN
vapi_valcount
ON
id
=
valcountid
ORDER
BY
year
,
week
,
code
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment