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 =
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:
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
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
>> 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
- 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"
- 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
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
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.
--
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
10 matches
Mail list logo