[progress Communities] [progress Openedge Abl] Forum Post: Re: Select Distinct Over Jdbc...

  • Thread starter Thread starter Jason Bailey
  • Start date Start date
Status
Not open for further replies.
J

Jason Bailey

Guest
On its face, it may not make a ton of sense, but there really is a reason. This particular table is used to keep track of customer notifications. Based on the contact preferences of the user (email, sms/text, automated phone call, etc), every notice sent to them could result in 1 or more entries in this table. My query doesn't care if one customer was only emailed and another customer was sent an email, sms/text and call. All my query cares about is who was notified -- at all. Right now I'm eliminating duplicate entries at the script/application level after the data has been pulled from the database (I only want to process one notification per customer). I'd like to have the database do that for me, if possible. It would greatly simplify things for me. Basically I only want to eliminate duplicates on one field/column, not on the entire record. Maybe OpenEdge won't do that. Once I've processed the table, I'm recording the notification's timestamp, which helps me identify later which notifications I have already analyzed and processed. If the table were my creation, I could adjust the format of the table to suit my needs, but in this case, it's not (it's actually part of a product being provided by a vendor of ours). Does that make a little more sense? My database experience is largely in MySQL and PostgreSQL (I'm a server/network guy, not a DBA), and I can easily accomplish what I want with that -- I'm just not very experienced with OpenEdge, so I don't know how to formulate the question in OpenEdge lingo. This may make better sense if I put it this way: +----------+-----------+----------+-------------------------+ | CUST_NBR | CUST_NAME | TYPE | TIMESTAMP | +----------+-----------+----------+-------------------------+ | 4424 | Mary | email | 2016-04-25 08:16:23.238 | +----------+-----------+----------+-------------------------+ | 3456 | John | email | 2016-04-25 08:17:30.134 | +----------+-----------+----------+-------------------------+ | 2789 | George | email | 2016-04-25 08:17:32.945 | +----------+-----------+----------+-------------------------+ | 4424 | Mary | text/sms | 2016-04-25 08:24:54.113 | +----------+-----------+----------+-------------------------+ | 3456 | John | text/sms | 2016-04-25 08:17:37.256 | +----------+-----------+----------+-------------------------+ | 4424 | Mary | call | 2016-04-25 08:27:33.468 | +----------+-----------+----------+-------------------------+ A result set like this from the above table would suit my purposes: +----------+-----------+-------------------------+ | CUST_NBR | CUST_NAME | TIMESTAMP | +----------+-----------+-------------------------+ | 2789 | George | 2016-04-25 08:17:32.945 | +----------+-----------+-------------------------+ | 3456 | John | 2016-04-25 08:17:37.256 | +----------+-----------+-------------------------+ | 4424 | Mary | 2016-04-25 08:27:33.468 | +----------+-----------+-------------------------+ Thank you!

Continue reading...
 
Status
Not open for further replies.
Back
Top