Bonjour,

Je souhaite n'avoir qu'une ligne de la requête suivante.
Partie a : cumul d'un count(*)
Partie b : récupération d'informations
2 tables sont impliquées

Pouvez-vous m'aider ?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
select distinct CPT_FID, NB, ETAT
from 
(
select AccountID as CPT_FID, count(*) as NB , '' As Etat from tblLCSPmeChange
where isstransactiondate between '2018-01-01 00:00:00.000' and '2019-02-24 23:59:00.000'
and AccountID in (
20000091,
20011357
)
group by AccountID ) a
 
union 
 
select CPT_FID, '' as NB, Etat
from 
(
select CustomerID as CPT_FID,  
case isdeleted 
    when '1' then 'Supprimée'
    when '0' then 'Active'  
    else 'Err' 
end as Etat
from tblCustomers
where CustomerID in (
20000091,
20011357
)) b