WordPress database error: [Table './ay6u3nor6dat6ba1/kn6_ayu1n9k4_5_actionscheduler_actions' is marked as crashed and last (automatic?) repair failed]
SELECT a.action_id FROM kn6_ayu1n9k4_5_actionscheduler_actions a WHERE 1=1 AND a.hook='aioseo_send_usage_data' AND a.status IN ('in-progress') ORDER BY a.scheduled_date_gmt ASC LIMIT 0, 1

WordPress database error: [Table './ay6u3nor6dat6ba1/kn6_ayu1n9k4_5_actionscheduler_actions' is marked as crashed and last (automatic?) repair failed]
SELECT a.action_id FROM kn6_ayu1n9k4_5_actionscheduler_actions a WHERE 1=1 AND a.hook='aioseo_send_usage_data' AND a.status IN ('pending') ORDER BY a.scheduled_date_gmt ASC LIMIT 0, 1

sort with order by first and then second | Loop and Break

sort with order by first and then second

orderby clause of mysql may be used with one or more columns if we want to sort first column with some order and then the second column with some other order if the values or fist column are in duplicate. This clause used as :

select * from <Table Name> order by <First Column>,<Second Column>.......,<Nth Column> 

Sample Table (four column in a table, select all table values

mysql> select * from orderingRecords;
+-------+------+------+------+
| Basic | DA   | TA   | RA   |
+-------+------+------+------+
|  1000 | 1200 | 1300 | 1400 |
|   900 | 1400 | 1400 | 1400 |
|  1600 |  900 | 1300 | 1700 |
|  1600 | 1800 | 1300 | 1100 |
+-------+------+------+------+
4 rows in set (0.00 sec)

Sort RA column in ascending order.

mysql> select * from orderingRecords order by RA;
+-------+------+------+------+
| Basic | DA   | TA   | RA   |
+-------+------+------+------+
|  1600 | 1800 | 1300 | 1100 |
|  1000 | 1200 | 1300 | 1400 |
|   900 | 1400 | 1400 | 1400 |
|  1600 |  900 | 1300 | 1700 |
+-------+------+------+------+
4 rows in set (0.00 sec)

As you can see values of RA 1400, 1400 are same, so we want to sort Basic column values in ascending order wherever values of RA(column) are similar. Indicated by following image :

Sorting another column (Basic) according to ascending order

Share

You may also like...