I need to compare 2 strings that contains number and possibly text. for example I have this table:
id | label 1 | label 2 | 1 | 12/H | 1 | 2 | 4/A | 41/D | 3 | 13/A | 3/F | 4 | 8/A | 8/B | ..
I need to determine the direction so that if Label 1 < Label2 then Direction is W (with) else it is A (against). So I have to build a view that presents data this way:
id | Direction 1 | A | 2 | W | 3 | A | 4 | W | ..
I'm using postgres 9.2.