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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.