RE: [PHP4BETA] select troubles
| From: | Andrew Hill | Date: | Wed, 19 Apr 2000 16:28:51 +0000 |
| Subject: | RE: [PHP4BETA] select troubles | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-13754@lists.php.net to get a copy of this message | ||
Mike,
You can try something like this:
Select distinct row from table where row in(select row from table where
condition2 or condition3) and row like condition1;
as long as your drivers support SQL properly.
Best regards,
Andrew
-----Original Message-----
From: mike@stratabase [mailto:mike@stratabase.com]
Sent: Wednesday, April 19, 2000 12:15 PM
To: php4beta@lists.php.net
Subject: [PHP4BETA] select troubles
Anyone know how to do select statement that has multiple conditions for
one field?
select distinct email from table
where name like 'mic%
email like '%.com' or email like '%.net'
now i want to select only the emails that start with mic, and that have a
.com or .net extension, not any of the others..
this works BUT it cancels out the where name like statement, it will find
all the emails that have .com or net, not the ones that start with mic.
I tried using and instead of or but that returned nothing because it is
looking for an email address with both '.com' and '.net' in it so im at a
loss any help would be great!
Mikey T