【发布时间】:2020-06-04 07:53:04
【问题描述】:
我有一个表调用“student_table”表,它有超过 100 个 STD_ID, 我需要从“Reg_table”表中映射 Student_reg_ID
student_table 格式
STD_ID
123
456
789
688
Reg_table 格式 第 1 列:Student_reg_ID 第 2 栏:参考
Student_reg_ID Reference
23124 stden id 123
56142 customer refer 456
14328 refer - 789
67890 code ref : 688
需要输出
STD_ID Student_reg_ID
123 23124
456 56142
789 14328
688 14328
我怎样才能得到如上图所示的输出?
我不想想在下面的类似函数中给出 100 多个 STD_ID
STD_ID Like '%123% or '%456% or .......
如何在单个 sql 中获取它?
【问题讨论】:
-
看起来你想要
reference like '% ' || std_id'。