sql - LIMIT on a condition in MySql -
I am trying to get information from the table in this form:
table_1
JBID (PK) project dis 1 1 2 2 3 3 4 5 5 . . . . .
What I am trying to find is a query that will give me 5 lines according to the project. (A limit on the WHERE statement, but not the entire selection)
If I use LIMIT, I get 5 results in total.
You can create SQL in a dynamic form by using the following query:
SELECT GROUP_CONCAT (Separate CONCAT ('Select work, projected, descends from jobs where projected =', projected, 'job limit 5 as per order') '' SEPARATOR 'union') ;
Save the result in one variable, and then execute the saved SQL.
Comments
Post a Comment