Recent

Author Topic: [FORGET] Extracting unique values from TDataSet  (Read 1424 times)

egsuh

  • Hero Member
  • *****
  • Posts: 1562
[FORGET] Extracting unique values from TDataSet
« on: December 19, 2024, 10:00:03 am »
Forget this. This question has been several times already.


Is there any way to do that from TDataSet descendants? 
In SQL, I can write

          select distinct fieldname from...
« Last Edit: December 19, 2024, 10:07:32 am by egsuh »

Zvoni

  • Hero Member
  • *****
  • Posts: 2914
Re: [FORGET] Extracting unique values from TDataSet
« Reply #1 on: December 19, 2024, 10:26:33 am »
Quick and dirty:
Throw the Values of the Dataset-Field you're interested in at a StringList which is set to sorted and not allow duplicates
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

egsuh

  • Hero Member
  • *****
  • Posts: 1562
Re: [FORGET] Extracting unique values from TDataSet
« Reply #2 on: December 19, 2024, 11:05:09 am »
Quote
Quick and dirty:
Throw the Values of the Dataset-Field you're interested in at a StringList which is set to sorted and not allow duplicates

I did it with TFPGMap<integer, integer> as my data type is integer ^^

 

TinyPortal © 2005-2018