1
I would like to know how I can bring some BD data. As for example client name, ID and date. In the company I work there are Service Orders, but some of these OS are of equal clients(same client but different OS). The company wants to know if this client came back in less than 24 hours to make a new OS. How can I do that?
SELECT id,cliente_id,
DATE_FORMAT(datcriacao, '%d-%m-%Y'),
count(cliente_id)
FROM sis_ordem_servico
group by cliente_id
order by id
That’s what I have for now, but it’s only bringing the date of an OS and not all as needed
Edit the question and add the table structure without knowing which specific fields is complicated to elaborate a correct answer.
– rray
Put the part of
create table ...
use the edit link below the blue comics. Here has a tips on how to work the site enjoy to read is very fast.– rray
Probably as it is a query question, you will refactor your sql, with some PHP data , report more, on the table structure .
– Ricardo Lucas