join - use of case when else in sql , not getting intended result -


i have following db table:

enter image description here

in questionmaster table, there language=1 english , language=2 spanish question.

i wanted display as:

srno       englishquestion        spanish question   1            english question     spanish question  2            live?   kuthe rahatos?   

for used following query:

select row_number() on (order qmid) srno, case language when 1 question end,case language when 2 question end questionmaster

but failed result.

please me.

you need aggregation want. 1 row can have 1 language on it.

try this:

select row_number() on (order qmid) srno,        max(case language when 1 question end) english,        max(case language when 2 question end) spanish questionmaster group qmid 

Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -