¿ªÔÆÌåÓý

Re: Insert or swap rows in a database table


 

R. Hari,
?
I forgot to give an example for adding a new row that will appear on top of the table. Here's what you nerd to do. Suppose the existing topmost sorted record (based on the value in the column that was added to the row with the name SortValue) has the value 010a. Then for the new added row, use the value of 005a, 005k, or 006w.
?
Now when you sort the table based on the SortValue column values, even though the new row added is physically the last bottom row in the table, the last row added will appear as the first row in the table.

[ad removed by moderator]

On Wed, Jan 15, 2020 at 1:35 PM, Henry J.H. Hom ×TÕñÍ¥
<ZHonorable@...> wrote:
R. Hari,
?
What you can do is to create an additional column (call it SortValue) and enter a value for each row in the order you wish to have thr rows sorted.??
?
The values that you enter will be dependent on the number of rows you expect to be imbedded between existing two rows on order for the new rows to be sorted between the two existing rows.
?
To begin with, you may want to enter a value of 010a for the row you want to be on top of the table.? Then the next row you want to appear underneath the row for 010a, you will enter 020a, and continue with your remaining rows in such a way that when you sort in the column SortValue, the rows will appear in the way you want to be arranged.??
?
For future subsequent row additions,? just an appropriate value for the column SortValue.
?
For example, if you need to add a row that need to be between a row that has a value of 030a and 040a, you can use 035a, 030m,? 031z,? or 032v.?
?
Hope this will help.

[ad removed by moderator]

On Tue, Jan 14, 2020 at 1:14 PM, Duane
<txpigeon@...> wrote:
On Tue, Jan 14, 2020 at 11:32 AM, R. Hari wrote:
But I want to move a row up or down.
Sorry, I misunderstood.? No, there's no way to move rows around, other than sorting on another column.

Duane
--
GMF's Wiki: /g/GroupManagersForum/wiki
Help: /static/help
Search button at the top of Messages list
A few site FAQs: /static/pricing#frequently-asked-questions

Join [email protected] to automatically receive all group messages.