- 论坛徽章:
- 0
|
增加了一个表,内容如下:
select pinyin dept_id,hz name,0 c from pinyinorder
- 1 a 啊 0
- 2 b 芭 0
- 3 c 擦 0
- 4 d 搭 0
- 5 e 蛾 0
- 6 f 发 0
- 7 g 噶 0
- 8 h 哈 0
- 9 i 0
- 10 j 击 0
- 11 k 喀 0
- 12 l 垃 0
- 13 m 呒 0
- 14 n 嗯 0
- 15 o 哦 0
- 16 p 啪 0
- 17 q 期 0
- 18 r 然 0
- 19 s 撒 0
- 20 t 塌 0
- 21 u 0
- 22 v 0
- 23 w 挖 0
- 24 x 昔 0
- 25 y 压 0
- 26 z 匝 0
复制代码
然后sql
- select * from (
- select * from (
- select b.dept_id,b.name, count(*) c
- from oper_info a, dept_info b
- where a.dept_id = b.dept_id
- group by b.dept_id,b.name
- having count(*) >0
- order by b.name)
- union
- select pinyin dept_id,hz name,0 c from pinyinorder
- ) a where a.name is not null order by a.name
复制代码
然后在程序里面循环,判断就可以了。。 |
|