mail-id table contains two columns(email_id,userid)
it contains different types of mail-ids,and no of users.
here username length is differ na,(ex-
tamil@yahoo.com,joshua@hotmail.com like)
now i want to fetch the email-ids only starting from '@'
(ex-@gmail.com,@yahoo.com,@hotmail.com

Answers were Sorted based on User's Feedback



mail-id table contains two columns(email_id,userid) it contains different types of mail-ids,and no ..

Answer / raji_4u

select substr(mail_id,instr(mail_id,'@',1)) from table_name

This works fine.

Is This Answer Correct ?    5 Yes 0 No

mail-id table contains two columns(email_id,userid) it contains different types of mail-ids,and no ..

Answer / paul

just tel me is that wat u exactly want

table -Email

email_id user_id
joy@yahoo.com joySmith
waine@gmail.com WaineR
@gmail.com tr222
@yahoo.com huip

if m not wrong in understanding ur question that is u
required the 2 records with emailid as @gmail.com and
@yahoo.com
then u can use the sql statment -with like...

select * from email where email_id like '@%';
email_id user_id
@gmail.com tr222
@yahoo.com huip

hope m correct...

Is This Answer Correct ?    2 Yes 2 No

mail-id table contains two columns(email_id,userid) it contains different types of mail-ids,and no ..

Answer / amitabha mandal

select substr(mail_id,instr(email_id,'@'),(length
(email_id,'@') - instr(email_id,'@'))+1) from table_name.

Is This Answer Correct ?    0 Yes 0 No

mail-id table contains two columns(email_id,userid) it contains different types of mail-ids,and no ..

Answer / rk

select substr(mail_id,1,instr(mail_id,'@')-1) from
test_rk_mail

Regards,

Is This Answer Correct ?    1 Yes 2 No

mail-id table contains two columns(email_id,userid) it contains different types of mail-ids,and no ..

Answer / mail2sentha



select email_id,user_id,substr(email_id,instr
(email_id,'@'),length(email_id)) from mail_id;

i think its correct?

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More SQL PLSQL Interview Questions

can a stored procedure call itself or recursive stored procedure? : Sql dba

0 Answers  


What is a join?Explain the different types of joins?

6 Answers   Bank Of India, CitiGroup, Google, ICICI, Saama Tech, SkyTech, TCS,


What are sql data types?

0 Answers  


What is varchar used for?

0 Answers  


Is it possible to Restore a Dropped Table using Rollback Command in Oracle SQL Plus ?

0 Answers   MCN Solutions,






if a string is there like s1,s2,s3,s4.How to find count of commas in this.

4 Answers  


how to create object in plsql

2 Answers   TCS,


C. Normalize the following data up to the 3rd Normal form. Create the tables and insert the data given. Emp_ID Name Dept_Name Salary Course_Title Date_Completed 100 Adam Marketing 48,000 SPSS 6/19/2008 Surveys 10/7/2008 140 Bob Accounting 52,000 Tax Acc 12/8/2008 110 Cathy IT SQL Server 1/12/2008 C# 4/22/2008 190 Dan Finance 150 Emily Marketing 55,000 SPSS 6/16/2008 42,000 Analysis 8/12/2008 Queries 1. Find all Names who have completed the SPSS Course. 2. Find employee with max salary. 3. Find employee with 2nd max salary. 4. Find all employees in Dept “Marketing”. 5. Find all the employees who have taken more than 2 courses. 6. Find all the employees who have completed the courses before month of September.

0 Answers  


What is the usage of when clause in trigger?

0 Answers  


What are the datatypes available in pl/sql ?

0 Answers  


What is Materialized View? In What Scenario we Use Materialized View?

2 Answers   Dinesh, Marlabs,


what are the advantages of package?

7 Answers   iFlex,


Categories