In the database table, I have about 1 million record.
In the number field there are about 11 digits number.
If the 5 digit number is the same, I want to group it so I can export it later.
How to archive this?
For example:
077129342480
074545344535
077127777476
077126565656
074546546654
You can see there are two group of number which are 07712 and 07454
In the group field I could declare the group name in number?
You can try
GROUP BY SUBSTR(number, 1, 5)orGROUP BY LEFT(number, 5).