jeudi 1 octobre 2015

mysql ordering, ordering rows, and put them in random order

I am building a query that I want to *order by last name *limit by certain rows .. IE limit 0 , 15 and next query limit 15 offset 16 *randomize the 15 row that I have queried.

my query will kinda do this, when I run the next query it will pull rows from the first set for some reason.

1stQ:  select ..... from table  order by table.lastname, rand() Limit 0, 15

2ndQ:

    select ..... from table order by table.lastname, rand(), limit 15 offset 16




Aucun commentaire:

Enregistrer un commentaire