repo.or.cz
/
sqlgg.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
minor
[sqlgg.git]
/
real.sql
blob
7b195ed8418aa2c66b3f264d34e5cff0b059ffcb
1
create table codeTable (locat INT, code TEXT, descript TEXT);
2
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;