how to get only latest record in database view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2022 03:30 AM
Hello
Is there anyway to get latest record in database view. i have created a database view but its showing duplicate records. i need only unique records, is it possible.
- Labels:
-
Reporting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2022 03:53 AM
Hi Kumar,
Unfortunately I don't think there's anything you can do specifically through the database view, but you can just group by a specific column on the view of the records. Alternatively you can create a report using count distinct on the specific value using your database view as the source.
You could also implement a GlideAggregate() query and use groupby from a script.
I know it's not exactly what you're looking for, but it might get you closer.
See below links that can also help:
Glide Record Aggregate "Distinct"
GlideAggregate - ServiceNow Wiki
To help others, please mark correct and/or helpful.
Thanks,
Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2022 05:21 AM
I need to get list report out of this db view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2022 06:14 AM
Hi Kumar,
Can you share an image of your database view or explain the database join if using custom tables please? You maybe returning duplicate records from the type of join(s) for example.
Please mark as helpful and/or correct in order to help others.
Thanks,
Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2022 09:52 PM