opam: update
[sqlgg.git] / sql / real.sql
blob96b987c0bf369f15c25dcdd415ba14f8294a885a
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     // gets unique code-and-descript combos
11        from codeTable
12        where locat not in (@lim1, @lim2)
13        group by code, descript
14       )
15     group by code
16     having count(*) > @x     // (error? should be "="?)
17    )
18  order by code, locat;