sql server - Convert MySql query into MSSql query -


here mysql query , want convert mssql. saw answers using microsoft sql server migration assistant mysql.

but since pc having issues installation of application, not perform it. can 1 me convert mysql query mssql query?

here query :

select regno, max(if(subject = 'cmis 1113', eligibility, null)) `cmis 1113`, max(if(subject = 'eltn 1113', eligibility, null)) `eltn 1113`, max(if(subject = 'imgt 1113', eligibility, null)) `imgt 1113` table_name  group regno 

you can use case expression:

select regno,        max(case when subject = 'cmis 1113' eligibility end) [cmis 1113],        max(case when subject = 'eltn 1113' eligibility end) [eltn 1113],        max(case when subject = 'imgt 1113' eligibility end) [imgt 1113] table_name  group regno 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -