Modifications diverses
[auf_coda_additions.git] / db / vues / auf_v_ControleBoursierBanques.sql
CommitLineData
22ab1788
EMS
1USE [coda-prod]
2GO
3
22ab1788
EMS
4SET ANSI_NULLS ON
5GO
6SET QUOTED_IDENTIFIER ON
7GO
4e57e206 8ALTER VIEW [dbo].[auf_v_ControleBoursierBanques]
22ab1788
EMS
9AS
10SELECT TOP 100 PERCENT E.code, B.nb_comptes
11FROM dbo.oas_element E LEFT OUTER JOIN
12 (SELECT elmcode, COUNT(*) AS nb_comptes
13 FROM oas_elmbanklist
14 WHERE elmcode LIKE '%L'
15 GROUP BY elmcode) B ON E.code = B.elmcode
16WHERE (E.elmlevel = 2) AND (E.deldate IS NULL) AND (E.endyear LIKE 0) AND (E.code LIKE '%L')
17ORDER BY B.nb_comptes DESC
22ab1788 18GO