I have yet to use Tableau Prep with Oracle, but I'm assuming you can use Custom SQL as an input. If so, you could simply use the statement you mentioned above.
Another possibility is to use a technique like what is mentioned here:
- Use Tableau Prep to select only the most recent record (by David Taylor)
- Latest Snapshot in Tableau and Maestro | VizPainter
The Custom SQL might have some performance benefits compared to the most recent record approach, though I'm not entirely certain as the underlying query may end up being equivalent.