




























编号为四字节数,最多四级部门,不允许为0x00000000,
表示方法为:0x01000000 0x02000000,…,0xFF000000为一级部门,
0x01010000为二级部门,其父部门为0x01000000,
0x01010101为四级部门,其对应的三级部门为0x01010100,
怎样查找1级部门 SQL
select * from dept where id%0x01000000=0
select * from dept where id%0x00010000=0 and (substring(cast(id as varbinary(255)),0,2) like 0x01) and id%0x01000000<>0
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。