Learn Java Stream from SQL Query : Distinct
April 04, 2018Sometimes there is some duplicate data that we think not important. Like Students in Scholl have address data but we only need from where they comes. So we want to distinct that data. I have 2 distinct type. First is get only unique data from subdata like address, or we want to keep distinct returning full Model data like representation only.
Code :
___________
result :
Ricoaw
Arisandy
Wijaya
Soekarno
Diponegoro
Patimura
Fatmawati
Hatta
You should put distinct after map to only get single subdata(field).
0 komentar