[AccessD] select top and limit...

Paul Hartland paul.hartland at googlemail.com
Thu May 5 03:06:40 CDT 2016


never used mysql and know nothing about this limit 10 (although just
quickly looked it up), but if the values in the query you are setting the
limit on are ascending, could you not use the limit 10 as a sub query like
below...off top of head something like below and assuming the table/query
has some sort of unique identifier on

SELECT *
FROM [yourtableorqueryhere] AS A
INNER JOIN
    (
        SELECT UniqueID, MAX([yourvaluefieldhere]) AS GetRecords
    ) AS B
ON
    A.UniqueID = B.UniqueID
OR
    A.[yourvaluefieldhere] <= B.GetRecords




On 5 May 2016 at 08:46, Kostas Konstantinidis <kost36 at otenet.gr> wrote:

> Hi all,
> I uae "LIMIT 10" in mysql query but what I really need is get also all the
> equal values with the 10th record
> I know that ms access do it by default with "select top" but I can't  make
> it to work in mysql
> Could you please help?
>
> Thank's
> /kostas
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>



-- 
Paul Hartland
paul.hartland at googlemail.com


More information about the AccessD mailing list