kavin

Oracle字符串分割Split(超简单一条sql解决)

kavin Python 2023-02-27 682浏览 0
SELECT (select wm_concat(name) from keming where instr(Course, code    ) > 0) FROM renyuan  where name ='张三'
解决如下问题
我现在有一个字段是存:1,2,3的,而它对应另一张值集表中。eg;

课程人员表 renyuan 
id    name     Course
1     张三      123

值集表    keming 
    code    name
     1       语文
     2       数字
      3       英语
………………

course 与code 关联   查询出结果为:

张三    语文,数字,英语

例子:

select distinct sc.park_count from screen_manager sc ,parklots p
where to_char(p.id) in (select belong_park from screen_manager) and sc.belong_park like  '%651%'

 

继续浏览有关 数据库技术文章/教程 的文章
发表评论