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

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

java - More than one row with the given identifier was found: 1, for class: com.model.Diagnosis -