what is the sql for this

Started by comesee, January 17, 2020, 08:08:59 PM

Previous topic - Next topic

comesee

i have tablename sales

id      name
1       fred
2       john
45     love
3       silver
21      tom


i want the id to look this way

id      name
1       fred
2       john
3       love
4       silver
5       tom 

what is the sql to fix this

Chen Zhen


Is it really necessary to change the values in the id column or do you just want to sort the data in ascending order by name for display?

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Kindred

#2
The biggest question is, WHY do you want to change this?

If you are looking to change the OD in the members table,  then the answer is DO NOT. Changing the I'd in the members table will screw up everything
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Chen Zhen


The name of the table is "sales".
I think this is just something custom that comesee is trying to sort for display.
Imo a simple order by name ascending clause will likely be what is sought.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Kindred

#4
1, comesee is known for lying
2, comesee still does not have an smf copyright
3, comesee posted in smf support, not scripting help

In short.
Nice try, comesee, but no
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

comesee


Illori


Advertisement: