Jump to content

Mysql queries


c_pattle

Recommended Posts

I was wondering if it is possible to perform the following query.  Say I have a list of names each with an id number ranging from 1 to 10.  Is it possible to perform a query where you list all of these records while repeating one records.  For example could I do a query that lists record number 6 then 10, 9, 8, 7, 6 etc.  Or another example would be listing record number 10, then 10, 9, 8, 7, 6 etc?

 

Thanks for any help. 

Link to comment
https://forums.phpfreaks.com/topic/218125-mysql-queries/
Share on other sites

Yeah sure.  For example if there is a table called "names" with the following data. 

 

idname

1frank

2james

3harry

4casey

 

Then I may want to do a query where I list all the records but repeating record number 3.  Therefore the result would be,

 

3 - Harry

1.  Frank

2.  James

3.  Harry

4.  Casey

Link to comment
https://forums.phpfreaks.com/topic/218125-mysql-queries/#findComment-1131955
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.