Is it possible to conditionally select columns in MySQL?

MYSQL DISTINCT SELECT FROM MULTIPLE COLUMNS?

  • what SQL statement can i use to achieve NAME SESSION TYPE MATHS ENG HIST ANA 1990 SSCE A* B C JONES 1990 SSCE D A B+ From the following database? NAME SESSION TYPE COURSE GRADE ANA 1990 SSCE MATHS A* ANA 1990 SSCE ENG B ANA 1990 SSCE HIST C JONES 1990 SSCE MATHS D JONES 1990 SSCE ENG A JONES 1990 SSCE HIST B+

  • Answer:

    You are not selecting from multiple columns, you are selecting from multiple rows and putting the results into multiple columns. And, no, I don't know the solution mainly because your table is not normalized, therefore making it hard to do a SQL selection.

Flora at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.