My query is that in table I have username and role name column
Eg
Username rolename project iD
Rahul dataentry 2
Vikas verifier 2
Binu verifier 3
Debashish dataentry 3
Now I want the result like
Dataentry verifier PROJECT ID
Rahul VIKAS 2
Debashish Binu 3
i have tried using case but the result is giving like
Dataentry verifier PROJECT ID
rahul null 2
null VIKAS 2
Debashish null 3
null Binu 3HI guys
My query is that in table I have username and role name column
Eg
Username rolename project iD
Rahul dataentry 2
Vikas verifier 2
Binu verifier 3
Debashish dataentry 3
Now I want the result like
Dataentry verifier PROJECT ID
Rahul VIKAS 2
Debashish Binu 3
i have tried using case but the result is giving like
Dataentry verifier PROJECT ID
rahul null 2
null VIKAS 2
Debashish null 3
null Binu 3
thanks in adnavce
pls help my whole work is stuck up bcoz of this|||On Jun 12, 12:33 pm, genius.j...@.gmail.com wrote:
> HI guys
> My query is that in table I have username and role name column
> Eg
> Username rolename project iD
> Rahul dataentry 2
> Vikas verifier 2
> Binu verifier 3
> Debashish dataentry 3
> Now I want the result like
> Dataentry verifier PROJECT ID
> Rahul VIKAS 2
> Debashish Binu 3
> i have tried using case but the result is giving like
> Dataentry verifier PROJECT ID
> rahul null 2
> null VIKAS 2
> Debashish null 3
> null Binu 3
> thanks in adnavce
> pls help my whole work is stuck up bcoz of this
select
max(case when rolename = 'dataentry ' then username end ) as
dataentry ,
max(case when rolename = 'verifier ' then username end ) as verifier ,
project_id
from table
group by project_id
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment