Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

loading unique values of a field

hi all,

how can i load a table data against the unique values of a particular field of the table.

i.e. load table party_m with only that data which contains unique values of field party_code

2 Replies
rbecher
MVP
MVP

You can load all distinct party_code values first:

dist_code:
load distinct party_code from party_m;


...and then load all rows where exists party_code:

party_m:
load * from party_m where exists(party_code);


- Ralf

Astrato.io Head of R&D
rbecher
MVP
MVP

I got it wrong in the first place.

dist_code:
load party_code where cnt = 1;
load party_code, count(party_code) as cnt from patry_m group by party_code;


Hope this helps.

Astrato.io Head of R&D