How to sort values in columns and update table?

前端 未结 7 2539
花落未央
花落未央 2020-12-05 15:28

I\'m completely new to sql and can\'t do that myself. So I need your help. I want to sort values in column and then save changes. But I don\'t know how to do that.

T

7条回答
  •  日久生厌
    2020-12-05 15:55

    it is simple. just use a few codes. I have tried this and it is working. first create a temporary table while sorting values at the same time.

        create table new as select * from games order by name;
    

    and then drop the games table using,

        drop table games;
    

    now create games table again with same properties and data as in new (where sorting here is an optional) using,

        create table games as select * from new order by name;
    

    now drop the temp table 'new'

        drop table new;
    

    now check your table. it must be sorted out.

提交回复
热议问题