I want to count the records in column 1 that start with 123, I need to count multiple times, with different values (123, 657, 897, ...) I have the values in column 2
- column1 | column2
- 1234567 | 123
- 5489186 | 135
- 1238756 | 548
SELECT column1, LEFT(column1,3) AS prefijo, column2 COUNT(LEFT(column1 = 123))
FROM DDBB.table