473,698 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

22 New Member
create table mail3(email varchar(50))
insert into mail3 values('mansi.s harma@yahoo.co. in')
insert into mail3 values('mansi.s harma+yahoo.co. in')
insert into mail3 values('mansi.s harma^yahoo.co. in')
insert into mail3 values('mansi.s harma*yahoo.co. in')
insert into mail3 values('mansi.s harma&yahoo.co. in')
insert into mail3 values('mansi.s harma!yahoo.co. in')
insert into mail3 values('mansi&s harma!yahoo.co. in')
select * from mail3

select * from mail3 where email like '%+%'
Above Query is wokimg fine for + sign.

But If I write the
select * from mail3 where email like '%+%' or '%*%'

Error is coming.Plz reply
Apr 10 '08 #1
6 1284
deepuv04
227 Recognized Expert New Member
create table mail3(email varchar(50))
insert into mail3 values('mansi.s harma@yahoo.co. in')
insert into mail3 values('mansi.s harma+yahoo.co. in')
insert into mail3 values('mansi.s harma^yahoo.co. in')
insert into mail3 values('mansi.s harma*yahoo.co. in')
insert into mail3 values('mansi.s harma&yahoo.co. in')
insert into mail3 values('mansi.s harma!yahoo.co. in')
insert into mail3 values('mansi&s harma!yahoo.co. in')
select * from mail3

select * from mail3 where email like '%+%'
Above Query is wokimg fine for + sign.

But If I write the
select * from mail3 where email like '%+%' or '%*%'

Error is coming.Plz reply
hi,
to pull the mail ids having the given symbols you can use the following query

Expand|Select|Wrap|Line Numbers
  1. select * from mail3 
  2. where email like '%+%' or email like '%*%' or
  3. email like '%^%' or email like '%&%'
  4.  
  5. or simply use the following query 
  6.  
  7. select * from mail3 
  8. where email not like '%@%'
  9.  
Apr 10 '08 #2
mansi sharma
22 New Member
Thx,It worked.
Plz see the following query-

SELECT * FROM mail3
WHERE email NOT LIKE '%@%'
or email not like '%&%'


Instead of showing the particular records ,the above query is displaying all the records.
Apr 10 '08 #3
Marcotte
5 New Member
Thx,It worked.
Plz see the following query-

SELECT * FROM mail3
WHERE email NOT LIKE '%@%'
or email not like '%&%'


Instead of showing the particular records ,the above query is displaying all the records.
That's because of the OR. For the email with the "&" in it, the where evaluates like this:

email NOT LIKE '%@%' --> True
email NOT LIEK '%&%' ---> False
so you have
True OR False, which evaluates to True.

Put another way, every record in the table either doesn't have a "&" or it doesn't have a "@".
Apr 10 '08 #4
mansi sharma
22 New Member
I didn't understand what r u trying to say.
Apr 10 '08 #5
ck9663
2,878 Recognized Expert Specialist
He's saying try to use AND instead of OR

-- CK
Apr 10 '08 #6
mansi sharma
22 New Member
Thanks ck,
I Got it.
Apr 11 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1757
by: tconti | last post by:
Howdy: I have 2 general questions regarding the use of XSLT to generate emails. We have several procecesses that use XSLT to generate emails. We frequently run into issues where a client complains that they cannot traverse hrefs in the emails. When er acquire the culprit email it appears that their reader is not handling the HTML encoded values (i.e. &) properly. Is this a problem only with older readers (i.e. old version of Lotus...
1
1079
by: Steven Bazeley | last post by:
I need to send a large list of emails from a webform by clicking a single button. Microsoft's documentation for coding this seems straight forward and I'm about to begin experimenting with their sample code (VB.NET). I would like to know if it is possible to use HTML to format the emails as opposed to just text, i.e. use a picture for the header, specify fonts, bold text, center text etc. all from information stored in a database. Any...
2
2101
by: Thief_ | last post by:
I need to monitor POP3 & IMAP servers for new emails. Ideally my app needs to sit in the system tray. Has anyone done this before? -- | +-- Thief_ | VB.NET 2003
12
6288
by: chadlupkes | last post by:
I've been trying to create a simple (I hope) PHP application to send emails to a membership list. I have yet to successfully connect to my database to pull the names and email addresses. I'm running XP Pro, PHP Version 4.3.2, Access 2000. I have created an ODBC System DNS connection to the database file I want to access, And I get this error: Warning: SQL error: , SQL state 00000 in SQLConnect in connecttodb.php on line 2 Whoops!...
1
1497
by: SpankyTClown | last post by:
Hi, Problem: How do I create a form that contains a pull down list for the source and destination (reference the table definition shown below) that shows the name of the item not the id number? The way I am doing it is through a query which only allows one name field. So I thought to do it through the pull down list, but it only displays the id. The pull down list will display both but upon selection just the id is displayed. I...
5
2438
by: Jai | last post by:
Hi, I am in a problem of sending mass emails(newsletter) to my website members. Actually my problem is this: I want to send newsletter to my website members. But I had given a facility for each member to choose different category of products or all products newsletter.
0
1778
by: damimkader | last post by:
Hi, I'm trying to send emails using a Macro based on an Excel Sheet and the Email Client I'm using is Lotus Notes. OS used - Windows Xp. Language - VB Below is the Code I'm using for doing the same. Dim Maildb As Object
3
1557
by: tangerine777 | last post by:
Hi, I've been trying to figure this problem out for a long time but couldn't figure it out. Basically I've been having trouble getting my HTML based email blasts (like e-newsletters you would get from HomeDepot.com etc) to display correctly in Hotmail. For some strange reason every time I start a new row or column (eg. <TR> <TD> etc) in a simple table, Hotmail causes creates a gap when it renders the HTML in its web-based client. As a...
2
1053
by: mansi sharma | last post by:
Que-) Create a Query to pull all emails from the domain-aol.com. This field is called ADR_EMAIL in the X Table. select ADR_EMAIL From X I do not understand what d question means,I simply select that field from the table As Above. Its Rite??
1
2038
by: asumansum | last post by:
how can i read emails from the website using inbox and outbox
0
8672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9155
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8858
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5859
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4614
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3038
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2322
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.