sql - how to select sepecific email domain from email column -


i have cust_tbl 1 of column email , user_id.

i have many records in cust_tbl, want show record have specific email domain (like @gmail.com) , user user_id = 'sysadmin1'.

i have tried query

select substr(email,instr(email,'@gmail.com'))   corp_usr  user_id = 'sysadmin1'; 

but shows email column (i want column filter) , still shows email that's not @gmail.com

what correct query this?

just use instr() in where clause :

select *  corp_usr  user_id = 'sysadmin1'   , instr(email,'@gmail.com') > 0; 

Comments

Popular posts from this blog

javascript - How do you prevent nested queries/catches in sequelize? -

java - Could not retrieve pre-bound Hibernate session - Could not obtain transaction-synchronized Session for current thread -

ruby on rails - ActiveRecord order not working -