getting the maximum value

2002-07-30 Thread destr0
If I hav a table "myTable": id nameamount 1john2 2joel 15 I want to get the name of the person with the largest amount.. but I can't seem to come up with a good query for this. I tried SELECT name FROM myTable WHERE amount =

LAST_INSERT_ID()

2002-04-23 Thread destr0
query, table When I run the query: SELECT LAST_INSERT_ID() as id FROM myTable; It returns the last inserted Id, but why does it return that value for every row in the table. for example. if there are 5 total records in the table. and the last inserted Id is 9, if I run the above query I get:

Re: row count in tables

2002-04-11 Thread destr0
figured it out... - Original Message - From: "destr0" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, April 11, 2002 11:51 AM Subject: row count in tables > sql, query > Is there a built-in to get t

row count in tables

2002-04-11 Thread destr0
sql, query Is there a built-in to get the number of rows in a table.. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thr

Re: backup databases

2002-04-02 Thread destr0
>> What would the script look like if I'm on Win2k ? > Good luck!! Don't listen to the naysayers @echo off set zdate=%date% set zdate=%zdate: =% set zdate=%zdate:/=-% C:\mysql\bin\mysqldump -A > E:\mysqlDataBackup\%zdate%.txt save as a .bat and put it in the scheduler. Mine runs every hou

Re: LIMIT, ORDER Dilema

2002-03-30 Thread destr0
- Original Message - From: "Paul DuBois" <[EMAIL PROTECTED]> To: "destr0" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, March 30, 2002 10:36 AM Subject: Re: LIMIT, ORDER Dilema > Does that even make sense? "records 30 - 45"

Re: LIMIT, ORDER Dilema

2002-03-30 Thread destr0
- Original Message - From: "Tyler Longren" <[EMAIL PROTECTED]> To: "destr0" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, March 30, 2002 9:38 AM Subject: Re: LIMIT, ORDER Dilema > You have to have the LIMIT clause after the ORDER clau

LIMIT, ORDER Dilema

2002-03-30 Thread destr0
Can you not have the LIMIT clause before the ORDER Clause in a select query? SELECT * FROM myTable LIMIT 30, 45 ORDER BY someField ASC; This query ^ fails with the error: Error 1064: You have an error in your SQL syntax near ' ORDER BY someField ASC' at line 1 I just want to make sure that th

using LIMIT 10, 40

2002-03-04 Thread destr0
Is it faster for mysql to return all of the rows in a table, or to return a set of rows picked out with a call like LIMIT 20, 40 I tried to test this myself from the shell, but seeing as how it's running on localhost I just get 0 seconds everytime. --

REGEXP vs LIKE

2002-03-03 Thread destr0
filter fodder: mysql, database, sql whigh one is faster? REGEXP or LIKE? - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request thi