Re: Query Problem

2005-03-16 Thread SGreen
get it in the format specified in the message, i.e. if > the title is the same, I do not want it to be printed again... > > Any ideas? > > >From: gerald_clark <[EMAIL PROTECTED]> > >To: Xristos Karvouneas <[EMAIL PROTECTED]> > >CC: mysql@lists.mysql.

Re: Query Problem

2005-03-16 Thread Xristos Karvouneas
message, i.e. if the title is the same, I do not want it to be printed again... Any ideas? From: gerald_clark <[EMAIL PROTECTED]> To: Xristos Karvouneas <[EMAIL PROTECTED]> CC: mysql@lists.mysql.com Subject: Re: Query Problem Date: Tue, 15 Mar 2005 14:49:45 -0600 Xristos Karvouneas

Re: Query Problem

2005-03-16 Thread Xristos Karvouneas
message, i.e. if the title is the same, I do not want it to be printed again... Any ideas? From: sol beach <[EMAIL PROTECTED]> Reply-To: sol beach <[EMAIL PROTECTED]> To: Xristos Karvouneas <[EMAIL PROTECTED]> Subject: Re: Query Problem Date: Tue, 15 Mar 2005 12:33:24 -0800 h

Re: Query Problem

2005-03-15 Thread gerald_clark
Xristos Karvouneas wrote: Dear All, I am faced with the following problem: I have got three tables - book,author and authorbook - containing information about books and authors (some books have multiple authors). I want to do a query that would print information like: Title 1 Author 1

Re: query

2005-03-15 Thread Gleb Paharenko
Hello. > the following query causes the mysqld server to close Yes. MySQL 5.0.2 not yet stable as we want. You may look in the error log to find the clues of shutdowns. See: http://dev.mysql.com/doc/mysql/en/error-log.html But I recommend you to upgrade to the latest bk source, which

Re: Query Help

2005-03-01 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, "Jim McAtee" <[EMAIL PROTECTED]> writes: > In another table like this with month/year fields I once created a > dummy date field that I populated with the date of the first of the > month (1//), just to facilitate queries like this. Is > there another approach? Can

RE: Query problem

2005-02-18 Thread Gordon
Did you want WHERE Name LIKE 'sandy' OR (main_data.Display_In_Search = 1 AND main_data.Expiry_Date >= CurDate()) OR WHERE main_data.Expiry_Date >= CurDate() AND (Name LIKE 'sandy' OR main_data.Display_In_Search = 1 ) -Original Message

Re: query performance

2005-02-17 Thread Coz Web
If you do I suggest you also include relevant table definitions and possibly a little sample data (plus an indication of total table sizes) and expected output, this will greatly assist anyone who my be able to help. Oh yes, and don't forget to state the version of MySQL you are running. Coz On

Re: Query: Get 100 itemid's for each id.

2005-02-14 Thread Jacob Friis Larsen
> > >This is my table: > > > > > >CREATE TABLE items ( > > > id int(10) UNSIGNED NOT NULL default '0', > > > itemid int(10) UNSIGNED NOT NULL auto_increment, > > > PRIMARY KEY (`itemid`) > > >); > > > > > >I'd like to get 100 itemid's for each id. I guess I could solve my problem with a subsele

Re: Query: Get 100 itemid's for each id.

2005-02-14 Thread Jacob Friis Larsen
> >This is my table: > > > >CREATE TABLE items ( > > id int(10) UNSIGNED NOT NULL default '0', > > itemid int(10) UNSIGNED NOT NULL auto_increment, > > PRIMARY KEY (`itemid`) > >); > > > >I'd like to get 100 itemid's for each id. > > > >Is that possible. If so, please show me how. > - you have i

Re: Query problem

2005-02-09 Thread DanielWalker
On Tuesday 08 February 2005 17:03, Coz Web wrote: > > This will (as I believe Daniel suggested) keep things relatively > simple, avoiding an overly complex query that you cannot maintain in > the future. Well, my solution was, as you'll have observed, vastly over-complicated. I think I'd misunder

Re: query problem in num_row

2005-02-08 Thread Ligaya Turmelle
Your not getting a valid result from your query. Add if (!$result) { echo 'Bad query - message: ' . mysql_error();} I think it will give you a syntax error on your query. MySQL syntax for the LIMIT clause is: [quote] The LIMIT clause can be used to constrain the number of rows returned by the SEL

Re: Query problem

2005-02-08 Thread Coz Web
On Tue, 08 Feb 2005 15:52:02 +0100, Joachim Klöfers <[EMAIL PROTECTED]> wrote: > Oh, oh, Joachim, > not able to calculate, but asking questions about queries. > > Coz , of course its supposed to be 1955 (id 13 & 47) > > Joachim > > > Coz Web schrieb: > Just to confirm, is amount2 for region 1

Re: Query problem

2005-02-08 Thread Coz Web
On Tue, 8 Feb 2005 11:37:20 +, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Tuesday 08 February 2005 08:09, Joachim Klöfers wrote: > > Hi, all > > > > I hope somebody can help me. > > > > > > Many thanks in advance > > Joachim > > That is a very thorny problem. May I observe that you wi

Re: Query problem

2005-02-08 Thread Coz Web
Just to confirm, is amount2 for region 1 supposed to be 1630 (id 47) or 1955 (ids 13 & 47)? Coz > What I would like to have is a result like this: > ++---+--+ > | region | sum(amount1) if current=J | sum(amount2) | > ++---

Re: Query problem

2005-02-08 Thread daniel
On Tuesday 08 February 2005 08:09, Joachim Klöfers wrote: > Hi, all > > I hope somebody can help me. > > Many thanks in advance > Joachim That is a very thorny problem. May I observe that you will find things much easier, if you add unique primary keys to tables 2 & 3, thus: ALTER TABLE ADD p

Re: Query Help

2005-01-23 Thread Michael Stassen
rmck wrote: I have two tables: DB 1: Table A: Userid: Dept: DB 2: Table B: Userid: Dept: Location: How would I query from DB 1 Table A for the Dept if I want to use that value for DB 2's Dept? Both DBs and tables have the same Userid. Does not work: Use 2; Select A.Dept from A where B.Userid =

Re: Query cache confused when using different client protocols

2005-01-21 Thread Gleb Paharenko
Hello. Yes. See a long discussion at: http://bugs.mysql.com/bug.php?id=6511 "Thomas van Gulick" <[EMAIL PROTECTED]> wrote: > Try this: > > Setup a database server, with MySQL 4.1, with query cache turned on > > Setup a client machine with MySQL 4.0 > Setup a client machine with M

Re: Query Help, Two Tables...

2004-12-24 Thread Roger Baklund
Jason Caldwell wrote: Hi I have two tables; tbl_Headers and tbl_SubItems. tbl_Headers contain my Header Items such as (fields: ID & HEADER) ID HEADER --- 1.00 TOPIC ONE 2.00 TOPIC TWO 3.00 TOPIC THREE tbl_SubItems contain Sub Header Items such as (fields: ID & SUBITEM)

RE: Query question

2004-12-23 Thread Ed Lazor
Thanks, Shawn. I didn't think count would just limit to the items being grouped - very handy =) -Ed > SELECT URL, count(1) as popularity > FROM yourtablename > GROUP BY URL > ORDER BY popularity DESC > LIMIT 50; -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

RE: Query question

2004-12-23 Thread Dimitar Georgievski
Ed, Try the following query select ID, DateAdded, URL, count(*) as 'cnt' from mytable group by URL order by cnt desc It should display the most numerous URLs in the table. dimitar -Original Message- From: Ed Lazor [mailto:[EMAIL PROTECTED] Sent: Thursday, Decemb

Re: Query question

2004-12-23 Thread SGreen
This will return the top 50 urls in descending order of popularity. SELECT URL, count(1) as popularity FROM yourtablename GROUP BY URL ORDER BY popularity DESC LIMIT 50; Feel free to adjust as needed. HTH, Shawn Green Database Administrator Unimin Corporation - Spruce Pine "Ed Lazor" <[EMAIL P

Re: Query with Average on COUNT(*) values?

2004-12-13 Thread Onemarty
Thanks, Shawn, this helped a lot, although I'm not there yet. (..and you got it absolutely right, I just couldn't explain it correctly). I tried to execute this in OpenOffice, but it seems to use a function called executeQuery(). I don't know if it's part of OpenOffice or a library routine in th

Re: Query with Average on COUNT(*) values?

2004-12-13 Thread SGreen
It's not a hard as you are making it out to be. You are already able to "Group" you data on a value that breaks your data into "useful chunks". In your case you already figured out one way to differentiate one hour from another and one weekday from another. (The value 'Sun 00' is different tha

RE: Query Cache

2004-12-07 Thread Alexis Cheshire
t has been returned from the Cache rather than the Direct from Raw Tables. Hope that is a bit clearer Cheers Skex -Original Message- From: Eric Bergen [mailto:[EMAIL PROTECTED] Sent: 07 December 2004 17:30 To: Alexis Cheshire Cc: [EMAIL PROTECTED] Subject: Re: Query Cache 'show'

Re: Query Cache

2004-12-07 Thread Eric Bergen
t; Sent: 07 December 2004 16:50 > To: Alexis Cheshire > Cc: [EMAIL PROTECTED] > Subject: Re: Query Cache > > Skex, > > show status like 'Qcache%'; > Will give you status of the query cache. There isn't a way to tell if a query > result came from the cache

RE: Query Cache

2004-12-07 Thread Alexis Cheshire
] Subject: Re: Query Cache Skex, show status like 'Qcache%'; Will give you status of the query cache. There isn't a way to tell if a query result came from the cache or not other than the time it took to return or if it's the only query ran between checks of the show statu

Re: Query Cache

2004-12-07 Thread Eric Bergen
Skex, show status like 'Qcache%'; Will give you status of the query cache. There isn't a way to tell if a query result came from the cache or not other than the time it took to return or if it's the only query ran between checks of the show status. Neither of these methods is very reliable. Cac

Re: Query--SelectionFromSameTable

2004-12-02 Thread SGreen
Suggestions intermixed with your questions below. However, because you only described your table and neglected to post the actual CREATE TABLE statement, I will need to make a few assumptions (the actual name of your table and the fact that missing data is stored as nulls are two I can think

Re: Query question

2004-11-16 Thread Brent Baisley
Quite possibly since 0 could also mean false depending on your comparison operator. For instance, using a generic if statement, these two would both evaluate to false: if(0) if(null) You should be very specific when checking for NULL. WHERE field IS NOT NULL or WHERE field IS NULL Also, you may

Re: query of two tables returns far too many rows, more than the two tables contain

2004-11-11 Thread Chip Wiegand
[EMAIL PROTECTED] wrote on 11/11/2004 02:05:17 PM: > What you want to do is to write a query that lists every record from > the dealers table OPTIONALLY matched up to rows on the > blackgate_users table wherever the names match. This is what the > LEFT JOIN operator was invented to do (you were

Re: query of two tables returns far too many rows, more than the two tables contain

2004-11-11 Thread SGreen
What happened is called a Cartesian product. You basically asked for a combination of every value from one table matched to every value from the other table. In your case you did have an "except"-type condition so you eliminated a few of the matches. Let me explain it this way: Imagine you have

Re: query stopped working

2004-10-28 Thread J S
After I ran some database updates last night, it seems to be working OK again today. Not sure what happened! Thanks anyway. JS. Hi. Uncommon situation. Please tell me, what OS do you use, MySQL version and how was it compiled? Is there any clues at the end of .err file? "J S" <[EMAIL PROTECTED]>

Re: query stopped working

2004-10-28 Thread Gleb Paharenko
Hi. Uncommon situation. Please tell me, what OS do you use, MySQL version and how was it compiled? Is there any clues at the end of .err file? "J S" <[EMAIL PROTECTED]> wrote: > Hi, > > I have this query which used to work really fast but now it just seems to > lock up the tab

Re: Query Help

2004-10-26 Thread Rhino
- Original Message - From: "Keith Warren" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 26, 2004 5:15 PM Subject: Query Help > I'm converting from LassoMySQL (MySQL 3.23.54) to the current version of > MySQL, and I'm running into a query problem. > > (sum(Rush)+sum(

Re: Query help

2004-10-17 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, John Mistler <[EMAIL PROTECTED]> writes: > I need help coming up with the following query: > My table: > +-+--+ > | rowID | dateOfPurchase | > +-+--+ > | 1 | '2004-1-17 08:00:00'

Re: Query optimization question

2004-10-04 Thread SGreen
When you don't have subselects, you have two options: temporary tables or JOINed queries.In your case, I think the temporary table is the better way to go. I would also eliminate the ABS() check so that I can compare values directly against the index. I know the math is correct your way but th

Re: Query optimization question

2004-10-04 Thread gerald_clark
Gerald Taylor wrote: Query optimization question I am selecting from a single table but it has a lot of rows and it has a very involved calculation. What I really want to do is is FIRST restrict the number of rows so that the big calculation is only performed on the ones that are within 3 degr

Re: query on a column with xml content

2004-09-28 Thread Paul DuBois
At 14:17 -0600 9/28/04, Elim Qiu wrote: Is there any tools or built-in functions for querying contents of a column that holds a xml file? If you mean using something like the standard string functions, yes. But I suspect you mean using something like XPath, in which case, no. If you mean something

RE: Query with group by

2004-09-21 Thread Jose Miguel Pérez
Hi Michael! Talking about the "query with group by issue"... > I'll explain my reasoning below. [...] > From the manual, section "7.2.8 How MySQL Optimizes LEFT > JOIN and RIGHT > JOIN" : > >A LEFT JOIN B join_conditi

Re: Query takes terribly long

2004-09-20 Thread Bill Easton
9, so you won't ever see the values for 2004-02-29. Maybe you only care about an approximate result, and none of this matters. - Original Message - From: Dirk Schippers To: Bill Easton Cc: [EMAIL PROTECTED] Sent: Monday, September 20, 2004 6:06 PM Subject: Re: Query takes

Re: Query takes terribly long

2004-09-20 Thread Dirk Schippers
Y(putdatetime) <> 29) ORDER BY putdatetime DESC LIMIT 0,30 HTH, Bill == Dirk Schippers wrote: == Date: Sun, 19 Sep 2004 18:35:24 +0200 From: Dirk Schippers <[EMAIL PROTECTED]> To: Jocelyn Fournier <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] Subject: Re: Query takes terribl

Re: Query takes terribly long

2004-09-20 Thread Dirk Schippers
=1 AND (MONTH(putdatetime) <> 2 OR DAY(putdatetime) <> 29) ORDER BY putdatetime DESC LIMIT 0,30 HTH, Bill == Dirk Schippers wrote: == Date: Sun, 19 Sep 2004 18:35:24 +0200 From: Dirk Schippers <[EMAIL PROTECTED]> To: Jocelyn Fournier <[EMAIL PROTECTED]> Cc: [EMAIL PR

Re: Query takes terribly long

2004-09-20 Thread Bill Easton
19 Sep 2004 18:35:24 +0200 From: Dirk Schippers <[EMAIL PROTECTED]> To: Jocelyn Fournier <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] Subject: Re: Query takes terribly long No, I'm quiet sure that isn't the case as I am testing the optimized version of my website on another databas

Re: Query takes terribly long

2004-09-19 Thread Dirk Schippers
celyn Fournier www.presence-pc.com - Original Message - From: "Dirk Schippers" <[EMAIL PROTECTED]> To: "Jocelyn Fournier" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, September 19, 2004 5:49 PM Subject: Re: Query takes terribly long Hello, Indee

Re: Query takes terribly long

2004-09-19 Thread Jocelyn Fournier
ECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, September 19, 2004 5:49 PM Subject: Re: Query takes terribly long > Hello, > > Indeed, when I use {put,front,putdatetime}, no filesort is used. But the > query is still very slow. > It takes about 2 seconds. And again, mysql prefe

Re: Query takes terribly long

2004-09-19 Thread Dirk Schippers
Cc: <[EMAIL PROTECTED]> Sent: Sunday, September 19, 2004 11:55 AM Subject: Re: Query takes terribly long Hello, Sorry to bother you again, but now I have the following, bit more complicated query on the same table: SELECT id FROM story WHERE MONTH(putdatetime) = MONTH('2004-09-19&#x

Re: Query takes terribly long

2004-09-19 Thread Jocelyn Fournier
s" <[EMAIL PROTECTED]> To: "Jocelyn Fournier" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, September 19, 2004 11:55 AM Subject: Re: Query takes terribly long > Hello, > > Sorry to bother you again, but now I have the following, bit more > comp

Re: Query takes terribly long

2004-09-19 Thread Jocelyn Fournier
gt; To: "Jocelyn Fournier" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, September 19, 2004 11:05 AM Subject: Re: Query takes terribly long > Hello, > > Thanks for the hint! > With RESET QUERY CACHE, I'm always sure that the cache is empty and with

Re: Query question

2004-09-19 Thread Andrew Kreps
On Sat, 18 Sep 2004 23:57:59 +0200, Schalk Neethling <[EMAIL PROTECTED]> wrote: > If I submit the following query: > > SELECT * FROM mi_verdicts_search WHERE doctype = 'Verdict' AND (state = > 'California: State Court' OR district = 'Circuit Court: Federal, Alaska' > OR appellate = 'US Supreme Cou

Re: Query takes terribly long

2004-09-19 Thread Dirk Schippers
QL query cache now ? (try RESET QUERY CACHE before testing your query to be sure) Regards, Jocelyn Fournier www.presence-pc.com - Original Message - From: "Dirk Schippers" <[EMAIL PROTECTED]> To: "Jocelyn Fournier" <[EMAIL PROTECTED]> Cc: <[EMAIL PR

Re: Query takes terribly long

2004-09-19 Thread Dirk Schippers
t;[EMAIL PROTECTED]> To: "Jocelyn Fournier" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, September 18, 2004 11:53 PM Subject: Re: Query takes terribly long Hello, Now this I don't understand, now the query takes only 0.05s on any of the two indexes. I di

Re: Query takes terribly long

2004-09-18 Thread Jocelyn Fournier
lyn Fournier" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, September 18, 2004 11:53 PM Subject: Re: Query takes terribly long > Hello, > > Now this I don't understand, now the query takes only 0.05s on any of > the two indexes. > I didn&#x

Re: Query takes terribly long

2004-09-18 Thread Dirk Schippers
rieve the row in the right order directly. Regards, Jocelyn Fournier www.presence-pc.com - Original Message - From: "Dirk Schippers" <[EMAIL PROTECTED]> To: "Jocelyn Fournier" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, Septembe

Re: Query takes terribly long

2004-09-18 Thread Jocelyn Fournier
e row in the right order directly. Regards, Jocelyn Fournier www.presence-pc.com - Original Message - From: "Dirk Schippers" <[EMAIL PROTECTED]> To: "Jocelyn Fournier" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, September 18, 2004

Re: Query takes terribly long

2004-09-18 Thread Dirk Schippers
Hello, I added the index you said, but mysql (yes 4.x) still prefers using the other index {put,front,topcategory,approvedby}. And indeed, he uses the filesort. When I force into using your index, it seems to be even slower (more rows but no filesort as you said) But I have a question about that

Re: Query takes terribly long

2004-09-18 Thread Jocelyn Fournier
Hi, You can try to add an index on (put,front,topcategory,putdatetime) to avoid MySQL has to do a filesorting on the data returned. (I assume you're using MySQL 4.x) Regards, Jocelyn Fournier www.presence-pc.com - Original Message - From: "Dirk Schippers" <[EMAIL PROTECTED]> To: <[E

Re: Query takes terribly long

2004-09-18 Thread Dirk Schippers
No, it doesn't improve the speed. I think that is because almost all rows in that table are approved. Are you also convinced that this is a very long time for such a query? Or is it normal? Andrew Kreps wrote: On Sat, 18 Sep 2004 22:25:12 +0200, Dirk Schippers <[EMAIL PROTECTED]> wrote: with

Re: Query with group by

2004-09-17 Thread Rhino
ast one of them ;-) Rhino - Original Message - From: "Michael Stassen" <[EMAIL PROTECTED]> To: "Rhino" <[EMAIL PROTECTED]> Cc: "Jose Miguel Pérez" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, September

Re: Query with group by

2004-09-17 Thread Michael Stassen
I took a closer look and found the problem -- char(date). Is char() necessary in DB2 to cast the date as a string? In MySQL, char() expects a list of integers to interpret as a list of character codes . Removing char() makes the query

Re: Query with group by

2004-09-17 Thread Michael Stassen
Jose Miguel Pérez wrote: Hi Michael! Yes, you're right, thanks for extending and clarifying my message. However, I'm not confident about your comments on the inefficiency for the following query: I'll explain my reasoning below. SELECT c1.date, c1.location, c1.version FROM cities

Re: Query with group by

2004-09-17 Thread Rhino
- As you can see, both queries worked and produced the same result in DB2, aside from the row sequence, which is easily fixable via an Order By. I'm at a loss to explain why my query didn't work in MySQL V4.1.4. Rhino - Original

Re: Query execution time?

2004-09-17 Thread Egor Egorov
joe mcguckin <[EMAIL PROTECTED]> wrote: > Does the mysql server return to the client (DBI in this case) the query > execution time? If so, how do I retrieve it? my $_startTime = time; $dbh->do("INSERT INTO dinner VALUES ('chicken','grille')"); print "Execution time: ".(time - $_startTime)."\n";

Re: Query with group by

2004-09-16 Thread Michael Stassen
Rhino wrote: I agree that Michael's solution with the temporary tables is the best I have seen so far. I can't take much credit. It's just an adaptation of the solution in the manual. I am running MySQL 4.0.15 so I don't have any subquery capability. As a result, I went to DB2 to come up with on

RE: Query Help

2004-09-16 Thread Lewick, Taylor
] Subject: Re: Query Help Add Backup date to your SELECT clause _and_ your GROUP BY clause. SELECT count(1) as attempts, client, status, bkupdate FROM bpdjobs WHERE Status not in (0,1) GROUP BY bkupdate, status, client HAVING attempts >5 This will break your report down by date, t

Re: Query Help

2004-09-16 Thread SGreen
Add Backup date to your SELECT clause _and_ your GROUP BY clause. SELECT count(1) as attempts, client, status, bkupdate FROM bpdjobs WHERE Status not in (0,1) GROUP BY bkupdate, status, client HAVING attempts >5 This will break your report down by date, then status, then client Shawn Green D

Re: Query Help

2004-09-16 Thread Rhino
This is the right place to ask the question but we could be a lot more helpful if you told us two additional things: 1. Which version of MySQL are you using? (Different versions of MySQL have different SQL capabilities so we don't want to show you a solution which wouldn't work on your version.) 2

Re: Query execution time?

2004-09-16 Thread Aman Raheja
As far as I know there isn't a way, though ideally there should be to do so. I would also look more for the answer and ask you to post it on the PER DBI mailinglist. Thanks Aman Raheja joe mcguckin wrote: Does the mysql server return to the client (DBI in this case) the query execution time? If s

Re: Query with group by

2004-09-16 Thread Jose Miguel Pérez
Hi Michael! Yes, you're right, thanks for extending and clarifying my message. However, I'm not confident about your comments on the inefficiency for the following query: > > SELECT c1.date, c1.location, c1.version > > FROM cities c1 > > LEFT JOIN cities c2 > >

Re: Query with group by

2004-09-16 Thread Vincent . Badier
>Which version of MySQL are you running? > >I'm having trouble thinking of a solution that doesn't involve a subquery >but subqueries aren't supported until version 4.1.x; I don't want to give >you a subquery if you can't run it. > >Rhino I'm running 3.23.43. -- Vincent -- MySQL General Mai

Re: Query with group by

2004-09-16 Thread Rhino
e - From: "Michael Stassen" <[EMAIL PROTECTED]> To: "Jose Miguel Pérez" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, September 16, 2004 10:47 AM Subject: Re: Query with group by > > Jose Miguel Pérez wrot

Re: Query with group by

2004-09-16 Thread Michael Stassen
Jose Miguel Pérez wrote: Hi Vincent! i'm trying to built a query that report me the latest tuple for a given field. I explain myself a bit. Let's say i have a table such this : There is no simple solution to your problem. Strictly speaking, it's forbidden to name a column in the SELECT clause w

Re: Query with group by

2004-09-16 Thread Jose Miguel Pérez
Hi Vincent! > i'm trying to built a query that report me the latest tuple for a given > field. > I explain myself a bit. Let's say i have a table such this : There is no simple solution to your problem. Strictly speaking, it's forbidden to name a column in the SELECT clause which is NOT on th

Re: Query with group by

2004-09-16 Thread Rhino
- Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, September 16, 2004 3:05 AM Subject: Query with group by > Hello all, > > i'm trying to built a query that report me the latest tuple for a given > field. > I explain myself a bit. Let's say i have a t

Re: Query error need help please

2004-09-14 Thread Greg Donald
On Tue, 14 Sep 2004 19:55:42 -0700, Soheil Shaghaghi <[EMAIL PROTECTED]> wrote: > I have a subroutine which checks for multiple entries and if a user has > voted once in the same day, it will not calculate the vote. However, I > found out that it does not really do this. > What it does is only look

Re: Query very slow - Using temporary; Using filesort

2004-09-09 Thread JVanV8
After Shawn's guidance, I tried inserting with the temporary table method using this: CREATE TEMPORARY TABLE tmpStats (KEY(product_id)) SELECT TP.thread_id, COUNT(TP.thread_id) AS num_posts, MAX(TP.post_date) AS last_update FROM thread_post AS TP INNER JOIN thread_link AS TL ON TP.thread_i

Re: Query very slow - Using temporary; Using filesort

2004-09-09 Thread JVanV8
Thanks Shawn, I'm going to give the temporary table idea a try. I did omit the 'category' table while testing but when I used EXPLAIN the # of rows for the thread_link join increased from 105 to 16326 so I decided to leave the category table in. But I agree, it isn't needed. My other idea I ha

Re: Query very slow - Using temporary; Using filesort

2004-09-09 Thread SGreen
I know you said this was a translation of your original query. Assuming that it is a faithful translation, I have the following suggestions: Do not enclose numbers with quotes (category_id is a number, right? No quotes are needed) You do not need include the table "category" in this query. You

Re: Query help

2004-09-07 Thread SGreen
The manual is your friend: http://dev.mysql.com/doc/mysql/en/SELECT.html Pay attention to the portion about the LIMIT clause. Shawn Green Database Administrator Unimin Corporation - Spruce Pine "Randy Paries" <[EMAIL PROTECTED]> wrote on 09/07/2004 04:15:28 PM: > > Hello, > I have a table > M

Re: Query Question

2004-09-05 Thread Stuart Felenstein
Well I feel like maybe I wasted some bandwidth here. I think what I'm looking for is a square peg in a round hole. That won't work. More to the point :) , I do not having a problem with the AND / OR / IN / NOT / etc. What I think I was attempting was to come up with a SQL statement that will work

Re: Query Question

2004-09-05 Thread Michael Stassen
Stuart Felenstein wrote: I'm hoping I can present this correctly. I'm trying to determine how to set up my where condition as, 1 way has already failed me. While I continue to figure this out (i'm a noob), I hope asking for some advice here won't be too awful. There is one main table where data

Re: Query Question

2004-09-05 Thread Stuart Felenstein
I think I'm on the right track but still in question After all the joins I added a "and LocationState = x". I'm not totally sure, because I want to search for records based on (for now)3 conditions (state, city, industry). Two things I should mention , the somewhat strange notation is becaue I'm

Re: Query hangs mysql 4.1

2004-09-03 Thread Mauricio Pellegrini
Hi, I don't mean to abuse, but could someone give me some help on how to upgrade from 4.1.1 Alpha to 4.1.4 gamma Any help gratly appreciated Mauricio On Thu, 2004-09-02 at 10:34, Heikki Tuuri wrote: > Mauricio, > > please send the FULL .err log to me. Do not cut anything off. > > [EMAIL PRO

Re: Query hangs mysql 4.1

2004-09-03 Thread Heikki Tuuri
nnoDB which also backs up MyISAM tables http://www.innodb.com/order.php Order MySQL support from http://www.mysql.com/support/index.html - Alkuperäinen viesti - Lähettäjä: "Mauricio Pellegrini" <[EMAIL PROTECTED]> Vastaanottaja: "Heikki Tuuri" <[EMAIL PROTEC

Re: Query hangs mysql 4.1

2004-09-02 Thread Heikki Tuuri
Mauricio, please send the FULL .err log to me. Do not cut anything off. [EMAIL PROTECTED] Best regards, Heikki Innobase Oy InnoDB - transactions, row level locking, and foreign keys for MySQL InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM tables http://www.innodb.co

Re: Query Help

2004-08-25 Thread Rhino
- Original Message - From: "Ronan Lucio" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 25, 2004 5:12 PM Subject: Query Help > Hi, > > I sorry for I neither didn´t find the information that I need in > the documentation nor found the correct words for a search > in

Re: query plan

2004-08-23 Thread Egor Egorov
Cao Duy <[EMAIL PROTECTED]> wrote: > How can I get the query plan output? See http://dev.mysql.com/doc/mysql/en/EXPLAIN.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __

Re: Query Help

2004-08-13 Thread Philippe Poelvoorde
john henry bonham wrote: If I want to update these day fields in this table: day, date, month, year -1 August 2004 -1 August 2004 I want on to be Sunday Lunchtime the other to be Sunday Evening. What query do I use that won't update both fields with the same data? maybe something

Re: Query Help

2004-08-13 Thread SGreen
Please post the entire contents of SHOW CREATE TABLE for this table and we will have enough information to answer your question. Shawn Green Database Administrator Unimin Corporation - Spruce Pine [EMAIL PROTECTED] wrote on 08/13/2004 09:48:21 AM: > If I want to update these day fields in this

Re: Query Cache

2004-08-08 Thread Terry Riley
Thanks to all who replied. Regards Terry Riley - Original Message - > We have the query cache turned on, and it appears to be working well. > > However, there appears to be no indication in the manual as to the time > that a cached query remains in memory. In the absence of this > in

Re: Query Cache

2004-08-07 Thread Dan Nelson
In the last episode (Aug 07), Paul DuBois said: > At 23:16 +0100 8/7/04, Terry Riley wrote: > > However, there appears to be no indication in the manual as to the > > time that a cached query remains in memory. In the absence of this > > information, is it safe to assume that a cached query remains

Re: Query Cache

2004-08-07 Thread Paul DuBois
At 23:16 +0100 8/7/04, Terry Riley wrote: We have the query cache turned on, and it appears to be working well. However, there appears to be no indication in the manual as to the time that a cached query remains in memory. In the absence of this information, is it safe to assume that a cached query

Re: Query Cache

2004-08-07 Thread Eric Bergen
Yes, a query cache is only removed when one of it's tables is updated or the server is restarted. -Eric On Sat, 7 Aug 2004 23:16 +0100 (BST), Terry Riley <[EMAIL PROTECTED]> wrote: > We have the query cache turned on, and it appears to be working well. > > However, there appears to be no indicat

Re: Query problem

2004-08-06 Thread gerald_clark
Schalk Neethling wrote: I run the following type of query against it: SELECT * FROM documents WHERE MATCH (content) AGAINST ('demyer Padgham robinson') AND doctype = 'Motion' AND jstate = 'California: State Court' OR jdistrict = 'Circuit Court: Federal, California' SELECT * FROM documents WHERE

RE: Query problem

2004-08-06 Thread Schalk Neethling
Hey there I have the following table structure: CREATE TABLE documents ( id int(11) NOT NULL auto_increment, user varchar(50) NOT NULL default '', olduser varchar(50) NOT NULL default '', username varchar(100) NOT NULL default '', uploaddate timestamp(14) NOT NULL, docdate varchar(100) NOT NU

Re: Query on multiple table with SUM and GROUP

2004-08-02 Thread Denis Geser
> On Monday 02 August 2004 02:39, Denis Geser wrote: > > I am using MySql to store telephone taxes statistics. > > I have 1 table by month with 60'000 rows each. > > > > My problem is that I need some stats for 3 month. > > For example I need to know the total Time(in second) and total Cost > > for

Re: Query on multiple table with SUM and GROUP

2004-08-02 Thread Whil Hentzen
On Monday 02 August 2004 02:39, Denis Geser wrote: > I am using MySql to store telephone taxes statistics. > I have 1 table by month with 60'000 rows each. > > My problem is that I need some stats for 3 month. > For example I need to know the total Time(in second) and total Cost > for each Number o

Re: Query on multiple table with SUM and GROUP

2004-08-02 Thread Egor Egorov
Denis Geser <[EMAIL PROTECTED]> wrote: > I am using MySql to store telephone taxes statistics. > I have 1 table by month with 60'000 rows each. > > My problem is that I need some stats for 3 month. > For example I need to know the total Time(in second) and total Cost > for each Number on a 3 month

Re: query for room reservations question

2004-07-29 Thread SGreen
When it comes to JOINS, there are 3 flavors in MySQL: LEFT, RIGHT, and INNER. This is an example of how to join two tables a and b: SELECT (some columns) FROM a XXX JOIN b ON (some logical comparison) WHERE (some overall condition) Behind the scenes, the data engine creates a virtual table tha

Re: query for room reservations question

2004-07-29 Thread Giulio
Brilliant ! thank you so much! only one more question: INNER JOIN is not a good choose because it lists only the record with a matching ON clause, and this is the only difference between LEFT and INNER, correct? thanks again, Giulio Il giorno 29/lug/04, alle 16:03, [EMAIL PROTECTED] ha scr

<    3   4   5   6   7   8   9   10   11   12   >