create table ProvinceCity (
CityID int not null,--主键ID
CityName varchar(50) null,--省市名称
RootID int null,--父ID
)
--想查询省市一条记录出来.如何写不用WITH
分享到:更多
------解决方案-------------------- select b.cityname, a.cityname from ProvinceCity a
inner join ProvinceCity b on a.rootid = b.cityid
where a.cityname = '名称'