Unix Technical Forum

select query question for MySQL 3.23

This is a discussion on select query question for MySQL 3.23 within the MySQL forums, part of the Database Server Software category; --> Greetings All, I'm struggling with this one. I'm trying to structure a query for MySQL 3.23. SELECT * FROM ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 10:12 AM
stat_holyday@hotmail.com
 
Posts: n/a
Default select query question for MySQL 3.23

Greetings All,

I'm struggling with this one.

I'm trying to structure a query for MySQL 3.23.

SELECT * FROM jos_liveshoutbox_temp WHERE id > "20" AND name="me" OR
name="cathy"

What I need to get is * WHERE id's > "20" from "me" and from "cathy".
What I'm getting from the above query is only * from "cathy".

It would be great if you could work MySQL queries like math:
SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND (name="cathy"
OR name="client")

Does anybody have any solution?

I'm working with MySQL 3.23. Please don't feel sorry for me.

Regards,
Luc M. Forget

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 10:12 AM
Captain Paralytic
 
Posts: n/a
Default Re: select query question for MySQL 3.23

On 10 Jul, 04:16, stat_holy...@hotmail.com wrote:
> Greetings All,
>
> I'm struggling with this one.
>
> I'm trying to structure a query for MySQL 3.23.
>
> SELECT * FROM jos_liveshoutbox_temp WHERE id > "20" AND name="me" OR
> name="cathy"
>
> What I need to get is * WHERE id's > "20" from "me" and from "cathy".
> What I'm getting from the above query is only * from "cathy".
>
> It would be great if you could work MySQL queries like math:
> SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND (name="cathy"
> OR name="client")
>
> Does anybody have any solution?
>
> I'm working with MySQL 3.23. Please don't feel sorry for me.
>
> Regards,
> Luc M. Forget


As far as I can se from the manual you can do:

SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND (name="cathy"
OR name="client")

What happens when you try it?

If it does fail, simply multiply out the brackets thus:

SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND name="cathy"
OR id > "21" AND name="client"

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 10:12 AM
stat_holyday@hotmail.com
 
Posts: n/a
Default Re: select query question for MySQL 3.23

Greetings, thanks for your response. I'm using phpMyAdmin 2.2.3 as an
interface, and as far as I can tell I'm getting a "Your SQL-query has
been executed successfully" response, but with no results... I've
tried both your recomendations, plus a few dozen variation, and still
nothing.... I'm bummed out.

Still looking for clues,
Luc M. Forget


On Jul 10, 1:42 am, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On 10 Jul, 04:16, stat_holy...@hotmail.com wrote:
>
>
>
> > Greetings All,

>
> > I'm struggling with this one.

>
> > I'm trying to structure a query for MySQL 3.23.

>
> > SELECT * FROM jos_liveshoutbox_temp WHERE id > "20" AND name="me" OR
> > name="cathy"

>
> > What I need to get is * WHERE id's > "20" from "me" and from "cathy".
> > What I'm getting from the above query is only * from "cathy".

>
> > It would be great if you could work MySQL queries like math:
> > SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND (name="cathy"
> > OR name="client")

>
> > Does anybody have any solution?

>
> > I'm working with MySQL 3.23. Please don't feel sorry for me.

>
> > Regards,
> > Luc M. Forget

>
> As far as I can se from the manual you can do:
>
> SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND (name="cathy"
> OR name="client")
>
> What happens when you try it?
>
> If it does fail, simply multiply out the brackets thus:
>
> SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND name="cathy"
> OR id > "21" AND name="client"



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 10:12 AM
lark
 
Posts: n/a
Default Re: select query question for MySQL 3.23

== Quote from stat_holyday ( stat_holyday@hotmail.com)'s article
> Greetings, thanks for your response. I'm using phpMyAdmin 2.2.3 as an
> interface, and as far as I can tell I'm getting a "Your SQL-query has
> been executed successfully" response, but with no results... I've
> tried both your recomendations, plus a few dozen variation, and still
> nothing.... I'm bummed out.
> Still looking for clues,
> Luc M. Forget
> On Jul 10, 1:42 am, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> > On 10 Jul, 04:16, stat_holy...@hotmail.com wrote:
> >
> >
> >
> > > Greetings All,

> >
> > > I'm struggling with this one.

> >
> > > I'm trying to structure a query for MySQL 3.23.

> >
> > > SELECT * FROM jos_liveshoutbox_temp WHERE id > "20" AND name="me" OR
> > > name="cathy"

> >
> > > What I need to get is * WHERE id's > "20" from "me" and from "cathy".
> > > What I'm getting from the above query is only * from "cathy".

> >
> > > It would be great if you could work MySQL queries like math:
> > > SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND (name="cathy"
> > > OR name="client")

> >
> > > Does anybody have any solution?

> >
> > > I'm working with MySQL 3.23. Please don't feel sorry for me.

> >
> > > Regards,
> > > Luc M. Forget

> >
> > As far as I can se from the manual you can do:
> >
> > SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND (name="cathy"
> > OR name="client")
> >
> > What happens when you try it?
> >
> > If it does fail, simply multiply out the brackets thus:
> >
> > SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND name="cathy"
> > OR id > "21" AND name="client"


try this:
SELECT * FROM jos_liveshoutbox_temp WHERE id > 21 AND (name="cathy" OR name="client")

no double quotes around id.
--
POST BY: lark with PHP News Reader
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 10:12 AM
stat_holyday@hotmail.com
 
Posts: n/a
Default Re: select query question for MySQL 3.23

Wow... that was an easy solution. Never dawned on me... I have to
remember that little trick they call "convention". Many, many thanks
lark!

Regards,
Luc M. Forget

On Jul 10, 7:02 am, lark <ham...@sbcglobal.net> wrote:
> == Quote from stat_holyday ( stat_holy...@hotmail.com)'s article
>
>
>
> > Greetings, thanks for your response. I'm using phpMyAdmin 2.2.3 as an
> > interface, and as far as I can tell I'm getting a "Your SQL-query has
> > been executed successfully" response, but with no results... I've
> > tried both your recomendations, plus a few dozen variation, and still
> > nothing.... I'm bummed out.
> > Still looking for clues,
> > Luc M. Forget
> > On Jul 10, 1:42 am, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> > > On 10 Jul, 04:16, stat_holy...@hotmail.com wrote:

>
> > > > Greetings All,

>
> > > > I'm struggling with this one.

>
> > > > I'm trying to structure a query for MySQL 3.23.

>
> > > > SELECT * FROM jos_liveshoutbox_temp WHERE id > "20" AND name="me" OR
> > > > name="cathy"

>
> > > > What I need to get is * WHERE id's > "20" from "me" and from "cathy".
> > > > What I'm getting from the above query is only * from "cathy".

>
> > > > It would be great if you could work MySQL queries like math:
> > > > SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND (name="cathy"
> > > > OR name="client")

>
> > > > Does anybody have any solution?

>
> > > > I'm working with MySQL 3.23. Please don't feel sorry for me.

>
> > > > Regards,
> > > > Luc M. Forget

>
> > > As far as I can se from the manual you can do:

>
> > > SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND (name="cathy"
> > > OR name="client")

>
> > > What happens when you try it?

>
> > > If it does fail, simply multiply out the brackets thus:

>
> > > SELECT * FROM jos_liveshoutbox_temp WHERE id > "21" AND name="cathy"
> > > OR id > "21" AND name="client"

>
> try this:
> SELECT * FROM jos_liveshoutbox_temp WHERE id > 21 AND (name="cathy" OR name="client")
>
> no double quotes around id.
> --
> POST BY: lark with PHP News Reader



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:00 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com