1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
SELECT
usr_prod.icomm_item.code as codebarre,
usr_prod.icomm_item.CALL_NUMBER as Cote,
usr_prod.icomm_item.catalog_id as Exemplaire,
count(usr_prod.dstat.text1) as nbr_out
FROM
usr_prod.dstat
RIGHT OUTER JOIN usr_prod.icomm_item
ON usr_prod.icomm_item.code = usr_prod.dstat.text1
WHERE substr(usr_prod.icomm_item.catalog_id, 17) in
(select usr_prod_v1.unimarc.UNIQUE_KEY
FROM usr_prod_v1.unimarc
WHERE (
usr_prod_v1.unimarc.UNIMARC12 like '19%'
))
AND
usr_prod.icomm_item.site=1
AND
usr_prod.icomm_item.CALL_NUMBER like '8%'
group by usr_prod.icomm_item.code, usr_prod.icomm_item.catalog_id, usr_prod.icomm_item.CALL_NUMBER
order by usr_prod.icomm_item.CALL_NUMBER, count(usr_prod.dstat.text1)
; |
Partager