mySQL SELECT query

Is there a way to make this part of a SELECT query more concise?

AND ministry_directory.listing_approved NOT LIKE '0' AND
ministry_directory.listing_approved NOT LIKE '4'

I know of the

IN ( 10, 12 )

command. Is there something similar available for NOT LIKE?

Ron


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ron Piggott [ Fr, 29 August 2008 19:09 ] [ ID #1966356 ]

Re: mySQL SELECT query

In the SQL standard this would be

AND NOT ministry_directory.listing_approved=0 AND NOT
ministry_directory.listing_approved=4

MySQL supports (and there are probably more RDBs that do):

AND ministry_directory.listing_approved!=0 AND
ministry_directory.listing_approved!=4

On Fri, Aug 29, 2008 at 7:09 PM, Ron Piggott <ron.php [at] actsministries.org> wrote:
> Is there a way to make this part of a SELECT query more concise?
>
> AND ministry_directory.listing_approved NOT LIKE '0' AND
> ministry_directory.listing_approved NOT LIKE '4'
>
> I know of the
>
> IN ( 10, 12 )
>
> command. Is there something similar available for NOT LIKE?
>
> Ron
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Evert Lammerts [ Fr, 29 August 2008 19:19 ] [ ID #1966357 ]

Re: mySQL SELECT query

------=_Part_23136_31604297.1220030490093
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

or NOT IN (0,4)

-- matt



On Fri, Aug 29, 2008 at 12:19 PM, Evert Lammerts
<evert.lammerts [at] gmail.com>wrote:

> In the SQL standard this would be
>
> AND NOT ministry_directory.listing_approved=0 AND NOT
> ministry_directory.listing_approved=4
>
> MySQL supports (and there are probably more RDBs that do):
>
> AND ministry_directory.listing_approved!=0 AND
> ministry_directory.listing_approved!=4
>
> On Fri, Aug 29, 2008 at 7:09 PM, Ron Piggott <ron.php [at] actsministries.org>
> wrote:
> > Is there a way to make this part of a SELECT query more concise?
> >
> > AND ministry_directory.listing_approved NOT LIKE '0' AND
> > ministry_directory.listing_approved NOT LIKE '4'
> >
> > I know of the
> >
> > IN ( 10, 12 )
> >
> > command. Is there something similar available for NOT LIKE?
> >
> > Ron
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

------=_Part_23136_31604297.1220030490093--
Matt Anderton [ Fr, 29 August 2008 19:21 ] [ ID #1966358 ]
PHP » gmane.comp.php.database » mySQL SELECT query

Vorheriges Thema: Problem after moving servers
Nächstes Thema: Test connection to database