473,414 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

limit 10 on mysql and equal values with the 10th record

1
Hi group,
I use "LIMIT 10" in mysql query but what I really need is to get also all the equal with the 10th record values.
I know that ms access do it by default with "select top" but I can't make it to work in mysql.
Searching around I didn't manage to find any familiar issue...
Could you please help? Thank's
the query is

Expand|Select|Wrap|Line Numbers
  1. SELECT 
  2.         T_people.person AS person,
  3.         COUNT(ST_peoplefilms.ID_films) AS CountOfID_films
  4.     FROM
  5.         ((MT_films
  6.         JOIN ST_peoplefilms ON ((MT_films.ID_films = ST_peoplefilms.ID_films)))
  7.         JOIN T_people ON ((T_people.ID_person = ST_peoplefilms.ID_person)))
  8.     GROUP BY T_people.person , T_people.man , ST_peoplefilms.ID_idiotita , MT_films.kind_movie
  9.     HAVING ((T_people.man = 1)
  10.         AND (MT_films.kind_movie ='ShortFilm')
  11.         AND ((ST_peoplefilms.ID_idiotita = 2)
  12.         OR (ST_peoplefilms.ID_idiotita = 13)
  13.         OR (ST_peoplefilms.ID_idiotita = 40)
  14.         OR (ST_peoplefilms.ID_idiotita = 44)
  15.         OR (ST_peoplefilms.ID_idiotita = 45)))
  16.     ORDER BY COUNT(`ST_peoplefilms.ID_films) DESC
  17.     LIMIT 10
May 10 '16 #1
0 1569

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: Rick | last post by:
Hi all, Is there a MySQL function to get the first record through a query? I would like to open a page of client records with the first one shown. The other records can be accessed from a...
4
by: Techhead | last post by:
I am trying to build a query that will pull every 10th record for example, or every other record, or even query 100 random records out of 10000? What select statement syntax would I use? ...
2
ak1dnar
by: ak1dnar | last post by:
CREATE TABLE `products` ( `p_id` int(11) NOT NULL, `p_name` varchar(15) default NULL, `p_features` varchar(100) default NULL ) from this table I am going to fetch the records and display...
0
by: jaejinkorean | last post by:
I don't know if this is the right place to ask this question... My php.ini file look like following.. There are some empty spot to fill.. I do not know what values should I assign,, To us mySQL...
9
isben22
by: isben22 | last post by:
I had a resource for this in the past but lost it somewhere... I have a need to enter daily information. Every day has to be accounted for, 24/7. I would like to make the default value of the...
1
by: djmeltdown | last post by:
I'm having trouble getting a foreach() loop to insert a record into a MySQL Database. Which I've never had any trouble before, it just seems quirky. I've tried the mysql_query statement without a...
1
by: bensonissac | last post by:
how to limit only integer values in a textbox..?
1
by: DiaZZ Ans | last post by:
If I run the code, the ISSessionExpired = sessionid then the array list gets printed. I am facing this problem all of a sudden. System.Web.SessionState.HttpSessionState curSession =...
1
by: Drei Divina | last post by:
hi everyone, i need some assistance. i need to compare records from table A (database A) and records from table B (database B) and display list of this records. But i need to filter the list...
4
by: kimbabcock | last post by:
I am trying to make a directory for my proposal database I am trying to associate the code with a command buttom that opens a form to add a new record. This is what I am trying to accomplish...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.