MySQL Forums
Forum List  »  Newbie

Select unique data
Posted by: Paweł Matyja
Date: February 06, 2023 02:21AM

Hi everyone.

I have query like that:

"SELECT calldate as DATE_i_TIME, src as NUM, duration as TIME_wait FROM cdr WHERE calldate > now() - interval 100 hour AND dcontext LIKE "ext-queues" AND disposition LIKE "NO ANSWER" AND lastapp like "Queue" and Userfield <> "1" and outbound_cnum = """

This query gives me data:

2023-02-02 13:53:23 +48601513000 4
2023-02-02 13:54:14 +48601513000 7
2023-02-02 13:54:15 +48601513000 6
2023-02-03 14:25:36 500478000 5
2023-02-03 14:25:36 500478000 5
2023-02-03 14:50:36 500478000 5
2023-02-03 14:50:36 500478000 5
2023-02-03 16:28:37 609945000 2
2023-02-03 16:33:26 +48609945000 2
2023-02-03 16:48:53 609945000 2
2023-02-03 16:53:24 609945000 2
2023-02-03 17:03:52 +48609945000 1
2023-02-03 17:10:32 +48609945000 2
2023-02-03 17:23:17 609945000 2
2023-02-04 14:10:58 +48609945000 12
2023-02-04 14:10:58 +48609945000 11

How to modify query to get unique number (from third column)
Like that:

2023-02-02 13:54:15 +48601513000 6
2023-02-03 14:50:36 500478000 5
2023-02-03 17:23:17 609945000 2
2023-02-04 14:10:58 +48609945000 11

I'am not database programmer, I need this query for my project.
I will be grateful for your help :)

Options: ReplyQuote


Subject
Written By
Posted
Select unique data
February 06, 2023 02:21AM
February 06, 2023 08:56AM
February 07, 2023 04:26AM
February 07, 2023 08:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.