Commit | Line | Data |
---|---|---|
22ab1788 EMS |
1 | USE [coda-prod] |
2 | GO | |
3 | ||
22ab1788 EMS |
4 | SET ANSI_NULLS ON |
5 | GO | |
6 | SET QUOTED_IDENTIFIER ON | |
7 | GO | |
4e57e206 | 8 | ALTER VIEW [dbo].[auf_v_ControleBoursierBanques] |
22ab1788 EMS |
9 | AS |
10 | SELECT TOP 100 PERCENT E.code, B.nb_comptes | |
11 | FROM 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 | |
16 | WHERE (E.elmlevel = 2) AND (E.deldate IS NULL) AND (E.endyear LIKE 0) AND (E.code LIKE '%L') | |
17 | ORDER BY B.nb_comptes DESC | |
22ab1788 | 18 | GO |