sql - Executing different queries depending on case statement -


I have a column called 'caller', which contains several values ​​i when the value of this column is 'major' , Then I want to execute the following:

  choose * from students *;   

And when there is something else, I want to execute:

  Choose from students differently;   

I used the case statement in the past to return a value. How can they be made to return a complete query? Alternatively, how can this problem be addressed without any problem?

Any help is appreciated.

I was giving a try on this. Basically, it gives you all the results for the Major and then adds other results.
  Select students where the solution = 'Major' UNION's selection body * Where the students will get the solution & lt; & Gt; 'Major'    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -