oracle left join case when then
来源:互联网 发布:编程的希望纪录片 编辑:程序博客网 时间:2024/04/30 12:36
项目中遇到这样的情况,A表中有省市区 三个字段, 省中默认有数据, 如果市中有数据 则显示市中 数据, 省市区中都有数据,则显示区中数据,由于 这三个字段中存的是城市编码, 需要到另外一张表 B 做关联, 和 B 中的number 字段关联,表B 中有text 字段, 显示城市名称
sql:
select t....... 省略
from A t
left join B ta on
case
when t.区is not null then t.int_lan_code
when t.市 not null then t.int_city_code
when t.省 is not null then t.int_org_code
end = ta.text
where t.cust_agrmt_code is not null
- oracle left join case when then
- oracle case when then
- oracle case when then
- oracle case when then
- case when then else end 以及 inner join left join 用法
- 一个复杂的mysql查询语句(case,when,then,left join )
- Oracle case when then else
- oracle 涉及行转列、复合查询、函数、 HAVING 、order by、group by、count、case when then、 join
- oracle case when then 条件判断
- Oracle中的case when then 用法.
- [ORACLE] case when then else end 应用
- [ORACLE] case when then else end 应用
- oracle case when then end 语句
- oracle case when then else end
- [ORACLE] case when then else end 应用
- [ORACLE] case when then else end 应用
- [ORACLE] case when then else end 应用
- oracle 存储过程 case when then
- 每日一练
- const修饰成员函数总结
- 随想录(由自定义打印函数想到的)
- SSH+ExtJs4开发项目的Demo实例视频讲解
- 编程珠玑笔记--排序
- oracle left join case when then
- Android利用Intent如何打开网页
- 算法之路
- hdu 1331 Function Run Fun(记忆化搜索)
- 《『若水新闻』客户端开发教程》——02.主界面设计
- Ruby on Rails,Routes配置routes.rb及请求解析规则
- undefined reference to 'pthread_create'
- 由JDBC浅谈JNDI及其在WebSphere中的配置和企业级应用中DB Session在Spring下的管理
- linux GCC 64位编程技巧