User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 374,005 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,778 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:
Views: 537 | Replies: 2 | Solved
Reply
Join Date: Apr 2008
Posts: 18
Reputation: mansi sharma is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mansi sharma mansi sharma is offline Offline
Newbie Poster

To pull all emails that contains +,^,*,&,!

  #1  
Apr 9th, 2008
--Que-4)Create a Query to pull all emails that contains
--characters +,^,*,&,!
  1. CREATE TABLE mail3(email varchar(50))
  2. INSERT INTO mail3 VALUES('mansi.sharma@yahoo.co.in')
  3. INSERT INTO mail3 VALUES('mansi.sharma+yahoo.co.in')
  4. INSERT INTO mail3 VALUES('mansi.sharma^yahoo.co.in')
  5. INSERT INTO mail3 VALUES('mansi.sharma*yahoo.co.in')
  6. INSERT INTO mail3 VALUES('mansi.sharma&yahoo.co.in')
  7. INSERT INTO mail3 VALUES('mansi.sharma!yahoo.co.in')
  8. INSERT INTO mail3 VALUES('mansi&sharma!yahoo.co.in')
  9. SELECT * FROM mail3

select * from mail3 where email like '%+%' or '%*%'

I have tried the above query but error is coming. Reply .thx in advance.
Last edited by peter_budo : Apr 10th, 2008 at 4:24 pm. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2008
Posts: 14
Reputation: huangzhi is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 4
huangzhi huangzhi is offline Offline
Newbie Poster

Re: To pull all emails that contains +,^,*,&,!

  #2  
Apr 10th, 2008
The correct code is:

select * from mail3 where email like '%+%' or email like '%*%'
Last edited by peter_budo : Apr 10th, 2008 at 4:24 pm. Reason: Keep It Organized - please use [code] tags
Hence Wijaya
www.ex-Soft.tk
Reply With Quote  
Join Date: Apr 2008
Posts: 18
Reputation: mansi sharma is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mansi sharma mansi sharma is offline Offline
Newbie Poster

Re: To pull all emails that contains +,^,*,&,!

  #3  
Apr 10th, 2008
Thx,It worked.
Plz see the following query-

  1. SELECT * FROM mail3
  2. WHERE email NOT LIKE '%@%'
  3. OR email NOT LIKE '%&%'

Instead of showing the particular records ,the above query is displaying all the records.
Last edited by peter_budo : Apr 10th, 2008 at 4:24 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MS SQL Marketplace
Thread Tools Display Modes

Other Threads in the MS SQL Forum

All times are GMT -4. The time now is 10:23 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC