Searching for equal data on different dates

Asked

Viewed 41 times

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.

  • 1

    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.

  • Probably as it is a query question, you will refactor your sql, with some PHP data , report more, on the table structure .

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.