-1

How to hide column field using sql query.

My query is:

Select Name,Email,Mobile from Table_Reg where Email not in('raj@gmail.com')

So i am not getting raj@gmail.com user details and output like below.

Name          Email         Mobile
Mazhar   mazhar@gmail.com   9030349582

I need to visible false email Id while in select query and also I want to add where email not in condition compulsory and I dont want to show email detail but email condition should compulsory. Output should like below.

 Name      Mobile
 Mazhar    9030349582
TheGameiswar
  • 27,855
  • 8
  • 56
  • 94
mazhar 124
  • 123
  • 1
  • 3
  • 16

1 Answers1

1

I am not sure what you actually need but give a go for below query:

Select 
    Name,
    case when Email in ('raj@gmail.com') then 'not visible'
        else Email
    end as Email,
    Mobile 
from Table_Reg 
Pawel Czapski
  • 1,856
  • 2
  • 16
  • 26