cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Translate the entire conversation x

Return top X results from Query Builder report

mmeadows-3
16-Pearl

Return top X results from Query Builder report

Version: Windchill 13.0

 

Use Case: I have a query that can return thousands of results but only need to see the first 10 to 20 based on sort order.


Description:

I can return the top 10 results in TSQL with:
SELECT TOP 10 {column} ... ORDER BY {column} DESC
Can we do this with Query Builder?

ACCEPTED SOLUTION

Accepted Solutions
avillanueva
22-Sapphire III
(To:mmeadows-3)
3 REPLIES 3
avillanueva
22-Sapphire III
(To:mmeadows-3)

avillanueva
22-Sapphire III
(To:avillanueva)

Hmm, if we had the ability to display the row number, it would be possible to put a condition that shows row numbers less than a value. ROW_NUMBER() or ROWNUM is a function but not one that is listed. I tried using it as a constant and it did not like it. No way to trick it to reading it like pure sql. 

You might be able to use a custom java class for this:

https://www.ptc.com/en/support/article/CS114482

Announcements

Top Tags