Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: comesee - tammikuu 17, 2020, 08:08:59 IP

Otsikko: what is the sql for this
Kirjoitti: comesee - tammikuu 17, 2020, 08:08:59 IP
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
Otsikko: Re: what is the sql for this
Kirjoitti: Chen Zhen - tammikuu 17, 2020, 09:13:04 IP

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?
Otsikko: Re: what is the sql for this
Kirjoitti: Kindred - tammikuu 17, 2020, 09:20:05 IP
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
Otsikko: Re: what is the sql for this
Kirjoitti: Chen Zhen - tammikuu 17, 2020, 09:29:37 IP

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.
Otsikko: Re: what is the sql for this
Kirjoitti: Kindred - tammikuu 17, 2020, 10:30:48 IP
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
Otsikko: Re: what is the sql for this
Kirjoitti: comesee - tammikuu 26, 2020, 05:59:12 IP
who is telling lie
Otsikko: Re: what is the sql for this
Kirjoitti: Illori - tammikuu 26, 2020, 07:00:35 IP
Lainaus käyttäjältä: comesee - tammikuu 26, 2020, 05:59:12 IP
who is telling lie

you are.