Advertisement
Guest User

Untitled

a guest
Aug 28th, 2017
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. users table structure
  2. ...........................................................................
  3. id email u_firstname status(0=inactive,1=active)
  4. ...........................................................................
  5. 1 varunjoshi919@gmail.com varun 1
  6. 2 abc@gmail.com abc 0
  7.  
  8. SELECT `id`,`email`,`u_firstname`,case u_status when '0' then 'inactive' when '1' then 'active' end as status FROM `users`
  9.  
  10. ...........................................................................
  11. id email u_firstname status(0=inactive,1=active)
  12. ...........................................................................
  13. 1 varunjoshi919@gmail.com varun active
  14. 2 abc@gmail.com abc inactive
  15.  
  16. ...........................................................................
  17. id email u_firstname status(0=inactive,1=active)
  18. ...........................................................................
  19. 1 varunjoshi919@gmail.com varun active
  20.  
  21. SELECT `id`,`email`,`u_firstname`,case u_status when '0' then 'inactive' when '1' then 'active' end as status FROM `users` where `u_status` like 'ac%'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement