I am using SQLite. I create a table called MyTable, with 3 columns MyID, MyOrder, MyValue, all are INTEGER types, as follows:
MyID       |     MyOrder        | MyValue
1          |         3          |       2
1          |         2          |       5
2          |         1          |       8
3          |         5          |       6
I need to select all MyID from the table, for each MyID, also return the number of rows with that MyID. In the above sample, the query should return:
        1|2
        2|1
        3|1
How to write this query?
 
    