如何使用Case语句从许多表中选择 [英] How I Can Select From Many Tables Using Case Statement

查看:272
本文介绍了如何使用Case语句从许多表中选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有4张桌子



StdntBtech,StdntPg,StdntUg,StdntDip



i必须插入值如果课程名称为BE或Btech

,则为StdntBtech



i如果课程名称为MCA或MSc,则必须向StdntPG插入值类似于

如果课程名称是BSc,
i必须向StdntUg插入值



类似

i必须在StdntDip中插入值,如果课程名称是Diploma



i已经给出了使用case语句在单个存储过程中插入值的指令





这是什么解决方案?

这个和select语句的语法是什么?

I have 4 tables

StdntBtech,StdntPg,StdntUg,StdntDip

i have to insert values into StdntBtech if the course name is BE or Btech
similarly

i have to insert values into StdntPG if the course name is MCA or MSc
similarly
i have to insert values into StdntUg if the course name is BSc

similarly
i have to insert values into StdntDip if the course name is Diploma

i have given instruction to insert values in a single stored procedure using case statement


What is the solution for this?
what will be the syntax of this and the select statement?

推荐答案

这篇关于如何使用Case语句从许多表中选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆