Commit bbe7d340 authored by Dorian's avatar Dorian
Browse files

rename file

parent 97c62eb6
#-----------------
# show all possibile history type
SELECT type FROM history GROUP BY type;
# show all type of actors
SELECT actor_type, potelet_id FROM attachments GROUP BY actor_type;
SELECT actor_type, potelet_id FROM history GROUP BY actor_type;
# show all the text from COMMENTS
# or all the href of PICTURES
SELECT text
FROM attachments
WHERE type='COMMENT';
# sort the actors by number of cases
SELECT responsibleOrganisation, count(*) AS c
FROM potelets
GROUP BY responsibleOrganisation
ORDER BY c;
# sort the actors by 'answering the most'
SELECT organisation, count(*) AS c
FROM attachments
GROUP BY organisation
ORDER BY c;
#-----------------
# potelets re-opened case by looking at attachment
SELECT potelet_id FROM attachment WHERE type='REOPEN_COMMENT';
# potelets re-opened case by looking at history
SELECT potelet_id FROM history WHERE type='INCIDENT_ASKED_REOPENING';
SELECT potelet_id FROM history WHERE type='INCIDENT_REOPENED';
# potelets marked as duplicates or severalOccurrence
SELECT * FROM potelets WHERE duplicates>0;
SELECT * FROM potelets WHERE severalOccurrence>0;
# => pas d'accès a ceux aux autres occurences ou duplicates...
# potelets where there is a lot of attachments
SELECT potelet_id, count(*) AS c
FROM attachments
GROUP BY potelet_id
HAVING c > 5;
# potelets where there is a lot of pictures/comment
SELECT potelet_id, count(*) AS c
FROM attachments
WHERE type='COMMENT'
GROUP BY potelet_id
HAVING c > 3;
SELECT potelet_id, count(*) AS c
FROM attachments
WHERE type='PICTURE'
GROUP BY potelet_id
HAVING c > 6;
# => got interesting result with this method (the one with a lot of comments)! look at 254080
# potelets where there is at least a professional actor responding
SELECT potelet_id, count(*) AS c
FROM attachments
WHERE type='COMMENT' and actor_type='PROFESSIONAL'
GROUP BY potelet_id
HAVING c > 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment