mysql - Double search values in the same field -


i need search "developer" , "publisher" record. both in same table. can search unique query or have search 2 times?

i wish that:

select * developers id_dev = 1 developer , id_dev = 2 publisher 

you can use case statement output either developer or publisher depending on id_dev column:

select *, case when id_dev = 1                'developer'                when id_dev = 2                'publisher'           end  developers  id_dev in (1,2) 

if id_dev can either 1 or 2 can remove where clause completely.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -