I have the table:
| cod | hora | produto | Amostra | Min | Max |
|-----|-------|---------|---------|-----|-----|
| 1 | 08:00 | 96722 | 1 | 100 | 200 |
| 2 | 08:23 | 96721 | 1 | 90 | 90 |
| 3 | 08:50 | 96722 | 2 | 100 | 100 |
| 4 | 09:50 | 96722 | 2 | 100 | 200 |
| 5 | 08:30 | 96721 | 2 | 90 | 90 |
| 6 | 08:28 | 96721 | 1 | 12 | 25 |
I want you to list me like this:
| cod | hora | produto | Amostra | Min | Max |
|-----|-------|---------|---------|-----|-----|
| 2 | 08:23 | 96721 | 1 | 90 | 90 |
| 5 | 08:30 | 96721 | 2 | 90 | 90 |
| 6 | 08:28 | 96721 | 1 | 12 | 25 |
| 1 | 08:00 | 96722 | 1 | 100 | 200 |
| 4 | 09:50 | 96722 | 2 | 100 | 200 |
| 3 | 08:50 | 96722 | 2 | 100 | 100 |
I'm trying to do it this way:
select * from tb_tabela
order by
tb_tabela.produto,
tb_tabela.amostra,
tb_tabela.hora
It is returning me wrong, as below:
| cod | hora | produto | Amostra | Min | Max |
|-----|-------|---------|---------|-----|-----|
| 2 | 08:23 | 96721 | 1 | 90 | 90 |
| 6 | 08:28 | 96721 | 1 | 12 | 25 | //errado
| 5 | 08:30 | 96721 | 2 | 90 | 90 |
| 1 | 08:00 | 96722 | 1 | 100 | 200 |
| 3 | 08:50 | 96722 | 2 | 100 | 100 | //errado
| 4 | 09:50 | 96722 | 2 | 100 | 200 |