Is there a nice way to get all the distinct values from a particular column from a data table? Obviously I can do a search and loop through but I thought I’d check if there was a nicer way. Generic example
Book_id|Book name| Book colour|Publish date
1 |book1 | Blue | 1/2/17
2 |book2 | Red |30/12/16
3 |book3 | Blue |5/7/17
I’m after a list of colours e.g. [Blue, Red]. I may also want to perform a function on them before checking if distinct, for example to get the years books are published [2016, 2017].
Any thoughts?