Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis MO
> - USA Central Time Zone
> 636-755-2652 fax 636-755-2503
>
> [EMAIL PROTECTED]
> www.nisc.coop
>
>> -Original Message-
>> From: Dan Buettner [mailto:[EMAIL PROTECTED]
>> Sent: Wedne
.x at this point in time
and this is a non-critical issue for me. Thanks for you help and advice.
If someone has another solution, please chime in.
Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis MO
- USA Central Time Zone
636-755-2652 fax 636-755-2503
[EMAIL PROTECTED]
www.
Dirk, you could try this:
(SELECT * FROM customertable
WHERE
ORDER BY customertableid DESC
LIMIT 50)
ORDER BY customertableid ASC;
Like one sometimes does with UNIONs, but without any UNIONs. Didn't
know whether it would work, but it does (on 5.0.21 anyway).
That will give you the 50 entries
On Wednesday 28 June 2006 01:39 pm, Dirk Bremer wrote:
> Dan,
>
> That might be close. The rows are inserted with an auto-increment
> primary key, but I have no ready way of knowing what the latest 50-IDs
> are. There are also various date columns, but I won't readily know the
> dates in this scena
EMAIL PROTECTED]
www.nisc.coop
> -Original Message-
> From: Dan Buettner [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 28, 2006 15:28
> To: Dirk Bremer
> Cc: mysql@lists.mysql.com
> Subject: Re: LIMIT Question
>
> Depends what you mean by "last" -
Depends what you mean by "last" - you could show the 50 with the
latest datestamps by ending your query with something like:
ORDER BY datestampcolumn DESC
LIMIT 50;
or the 50 with the highest ID numbers, same thing:
ORDER BY id DESC
LIMIT 50;
only real problem there is then they're sorted high
Is there a way to use a LIMIT clause to show the last X amount of rows
or a way to emulate this behavior? For example, a table has somewhere
between 1000 and 2000 rows, but you just want to see the last 50. These
last 50 might be the most recent entries, for example. Can this be done
in single quer
At 3:46 pm + 7/2/06, [EMAIL PROTECTED] wrote:
>Yes, you can do multi-way joins, and people often do. My biggest is 3-way, but
>some people do at least 5-way.
My record is and 8-way join (7 tables, one twice). So there! ;-)
>Beware that it is easy to specify operations which will heavily load
On Tue, February 7, 2006 10:46 am, [EMAIL PROTECTED] wrote:
> "David T. Ashley" <[EMAIL PROTECTED]> wrote on 07/02/2006 14:03:04:
>
>> a)Will MySQL allow joins that involve more than two tables (in my case,
>> perhaps as many as 5)?
>>
>> b)Can limits on a key field be included in the join in the s
"David T. Ashley" <[EMAIL PROTECTED]> wrote on 07/02/2006 14:03:04:
> Hi,
>
> I have several tables linked in various ways so that an inner join is
> possible. However, at the same time and in the same SQL query, I'd also
> like to query by some field values in one of the tables.
>
> Two quick
David T. Ashley wrote:
Hi,
I have several tables linked in various ways so that an inner join is
possible. However, at the same time and in the same SQL query, I'd also
like to query by some field values in one of the tables.
Two quick questions:
a)Will MySQL allow joins that involve more th
Hi,
I have several tables linked in various ways so that an inner join is
possible. However, at the same time and in the same SQL query, I'd also
like to query by some field values in one of the tables.
Two quick questions:
a)Will MySQL allow joins that involve more than two tables (in my case,
There is a HUGE limit on the size of the results of a query but I don't
know exactly what yours will be. I do know it should be more than 2GB so I
don't think your 4500 fields of data (300X15) will meet that limit.
However, there is a practical limit on how many queries can be UNIONed
into one
Works great.
Is the a limit on the size of the query. There are
currently 50 queries (may go upto 300 in future) and
each has 15 cols (250b each query) which makes the
entire query 12kb (250 x 50).
Thanks,
Jay
--- Michael Stassen <[EMAIL PROTECTED]>
wrote:
> Right.
>
> (SELECT col1, col2,
Right.
(SELECT col1, col2, col3, col4 FROM table1, table2
WHERE table1.col1 = table2.col1 and table1.col2 = 1
ORDER BY col3 DESC LIMIT 5)
UNION
(SELECT col1, col2, col3, col4 FROM table1, table2
WHERE table1.col1 = table2.col1 and table1.col2 = 2
ORDER BY col3 DESC LIMIT 5)
I believe you need to combine the results of 3 separate queries (each with
a limit of 5) into a temp table and respond with the contents of the table
you built. If I read this correctly
(http://dev.mysql.com/doc/mysql/en/UNION.html) you could do the same thing
with a UNION query and skip the t
Yes. I want to retrieve 5 of each.
If I put LIMIT 5, the entire query retrieves only 5
for table1.col2 with value of 1 because 1 is the first
in the IN (1,2,3) clause.
If I put LIMIT 15, the query returns 15 rows same as
above instead 5 for each 1, 2, and 3 values. This is
because there are more
Why do you think it doesn't work with LIMIT? Do you want 5 of each?
Michael
Jay K wrote:
Hi,
I have multiple queries like this:
SELECT col1, col2, col3, col4 FROM table1, table2
where table1.col1 = table2.col1 and table1.col2 = 1
ORDER BY col3 desc LIMIT 5
and
SELECT col1, col2, col3, col4 FROM ta
At 01:12 AM 7/20/2003, you wrote:
my table is small but I can't tell what is faster.. a max or a limit
mysql> select max(counter) from web;
mysql> select counter from web order by counter desc;
They seem to be the same in performance.
Regards,
Jake Johnson
[EMAIL PROTECTED]
Jake,
I tried
my table is small but I can't tell what is faster.. a max or a limit
mysql> select max(counter) from web;
mysql> select counter from web order by counter desc;
They seem to be the same in performance.
Regards,
Jake Johnson
[EMAIL PROTECTED]
_
At 12:32 PM 7/20/2003, you wrote:
This is probably easy, but I just can't to put my finger on it. I have a
list of numbers (i.e. 1 to 175) and I want to do a select statement to
get the highest number. I have tried the limit thing but not getting the
right output. Can someone shed some light on thi
At 13:32 -0400 7/20/03, C. Reeve wrote:
This is probably easy, but I just can't to put my finger on it. I have a
list of numbers (i.e. 1 to 175) and I want to do a select statement to
get the highest number. I have tried the limit thing but not getting the
right output. Can someone shed some light
This is probably easy, but I just can't to put my finger on it. I have a
list of numbers (i.e. 1 to 175) and I want to do a select statement to
get the highest number. I have tried the limit thing but not getting the
right output. Can someone shed some light on this?
TIA
--
MySQL General Maili
Hello Andrey,
Friday, July 11, 2003, 7:28:27 PM, you wrote:
http://www.mysql.com/doc/en/SELECT.html
.
The LIMIT clause can be used to constrain the number of rows returned by the SELECT
statement.
LIMIT takes one or two numeric arguments. The arguments must be integer consta
Andrey <[EMAIL PROTECTED]> wrote:
>
> I have a following question:
>
> I have a table with thousands of rows which i need to show in a String Grid ( I use
> Borland Delphi with MyDac component which implements MySQL interface).
>
> If i make a query
> SELECT * FROM tbl WHERE col1="something"
Hello
I have a following question:
I have a table with thousands of rows which i need to show in a String Grid ( I use
Borland Delphi with MyDac component which implements MySQL interface).
If i make a query
SELECT * FROM tbl WHERE col1="something",
it can cause retreival of 10,000 records
26 matches
Mail list logo