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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| 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" |
| |||
| 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" |
| |||
| == 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 |
| ||||
| 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 |