+ ESCAPE
[sqlgg.git] / real.sql
blob7b195ed8418aa2c66b3f264d34e5cff0b059ffcb
1  create table codeTable (locat INT, code TEXT, descript TEXT);
3  select * 
4  from codeTable
5  where locat not in (@lim1, @lim2)
6  and code not in
7    (
8     select code
9     from 
10       (select code, descript
11        from codeTable
12        where locat not in (@lim1, @lim2)
13        group by code, descript
14       )
15     group by code
16     having count(*) > @x
17    )
18  order by code, locat;