cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Statement Select DISTINCT in SAP Data Services

kapilpatil
Active Contributor
0 Kudos

Hello All,

I am using below SQL logic in SAP DATA services script to get a single distinct value from the column DATE_ATTR:

sql(' Data source', 'SELECT DISTINCT DATE_ATTR from TABLE WHERE status = 0 AND AMOUNT > 0 and DATE_ATTR <> NULL');

I have executed this SQL logic(using appropriate operators) in the SQL editor, it returns just one date value that is there. If there are multiple distinct values, I will need to know to how can I read result values.

So my query for above to be used in SAP DS script:

1. If there are multiple distinct values returned by the SQL query, Is there a way to read/store those values in the SAP DS scripts?

Thanks

View Entire Topic
Julian_Riegel
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi there,

why don't you build this logic inside a Dataflow and store the result into a temporary table?

kapilpatil
Active Contributor
0 Kudos

Hello Julian, Thanks for your response. Yes, I have achieved this logic using a query transform. I was just thinking if array can be fetched.