PDA

View Full Version : Convert values in QListView



ro12man3
22nd March 2016, 20:41
Hi!

My QListView after SQL query has that list:
40
40002F
40231S
40297S

And I want to convert all values that begin at 40 to 40, without duplication, so it should be:
40

Can you help me?

ChrisW67
26th March 2016, 22:07
Change your SQL:


Select distinct substr(column, 1, 2)
From tableofinterest
Order by substr(column, 1, 2);
-- or
Select substr(column, 1, 2)
From tableofinterest
Group by substr(column, 1, 2)
Order by substr(column, 1, 2);