sql关键字 With
来源:互联网 发布:手机淘宝店铺怎么注册 编辑:程序博客网 时间:2024/05/03 23:31
oracle和sqlserver里面是有with这个关键字的
sqlserver:
1:
with nodes as (select a.id ,a.name text,a.superorId parentId from BT_CountryRelation a where a.superorId=-1union all select a.id ,a.name text,a.superorId parentId from BT_CountryRelation a inner join nodes b on a.superorId = b.id)select c.id,c.name text,c.superorId parentId from BT_CountryRelation c where c.id in(select id from nodes) and c.superorId <>-1
2:
public Map<?,?> getCityInfoMap(HttpServletRequest request){String cityId = req.getValue(request, "cityName");//String sql = " select * from BT_Summarize where summarize_address = '"+cityId+"'";String sql = " with jj as (select summarize_content jj from BT_Summarize where summarize_address='"+cityId+"' and summarize_type='简介') "+",ms as (select summarize_content ms from BT_Summarize where summarize_address='"+cityId+"' and summarize_type='美食') "+",gw as (select summarize_content gw from BT_Summarize where summarize_address='"+cityId+"' and summarize_type='购物') "+",jt as (select summarize_content jt from BT_Summarize where summarize_address='"+cityId+"' and summarize_type='特价门票') "+"select * from jj , ms , gw , jt";log.debug("城市简介sql:"+sql);return db.queryForMap(sql);}
- T-SQL with关键字
- T-SQL with关键字
- T-SQL with关键字
- sql关键字 With
- T-SQL with关键字
- SQL Server 2008 关键字WITH 的作用
- T-SQL with关键字(转载)
- T-SQL with关键字 with as 递归循环表
- T-SQL with关键字 with as 递归循环表
- sql 2005 递归 查询部门所有子部门 with关键字
- 利用with关键字写sql语句的一个小技巧
- SQL Server 2005---使用with关键字解决递归父子关系
- SQL 关键字
- SQL关键字
- SQL关键字
- SQL关键字
- sql关键字
- SQL关键字
- matlab_关于倾斜校正的函数
- 2013长春网络赛 1010 Flyer
- php文件缓存类
- CUDA: 理解CUDA
- 倾斜校正-表格图像的校正
- sql关键字 With
- MySql使用Hibernate的异常的总结
- winsock程序与pcap.h文件共用引起的问题
- 设计一个函数实现将一个字符串中的大写字符变为小写字符,小写字符变为大写字符,数字不变,删除其他字符
- easyui datagrid使用
- 项目中漏掉了的东西,以及不足总结
- 不使用代理访问若干墙外站点的方法
- Linux操作系统上安装MYSQL总结
- 数据对接—kettle使用之三