日期:2014-05-17 浏览次数:20567 次
with business as
(
select 1 id ,'中国' as name,null pid union all
select 2 id ,'江苏' as name,1 pid union all
select 3 id ,'山东' as name,1 pid union all
select 4 id ,'广东' as name,1 pid union all
select 5 id ,'南京' as name,2 pid union all
select 6 id ,'苏州' as name,2 pid union all
select 7 id ,'常州' as name,2 pid union all
select 8 id ,'济南' as name,3 pid union all
select 9 id ,'青岛' as name,3 pid union all
select 10 id ,'广州' as name,4 pid union all
select 11 id ,'深圳' as name,4 pid union all
select 12 id ,'六合' as name,5 pid union all
select 13 id ,'龙池' as name,12 pid
)
select * from business
create table business
(id int,name varchar(10),pid int)
insert into business
select 1 id ,'中国' as name,null pid union all
select 2 id ,'江苏' as name,1 pid union all
select 3 id ,'山东' as name,1 pid union all
select 4 id ,'广东' as name,1 pid union all
select 5 id ,'南京' as name,2 pid union all
select 6 id ,'苏州' as name,2 pid union all
select 7 id ,'常州' as name,2 pid union all
select 8 id ,'济南' as name,3 pid union all
select 9 id ,'青岛' as name,3 pid union all
select 10 id ,'广州' as name,4 pid un