I would like to query the table by getting unique entries in field1 and field2 when selecting a row with field4 so that it takes precedence over some value, not zero.
eg. in the original table
field1 field2 field3 field4 1 BA (null) 1 BA 2 2 CA 3 2 DA (null) 3 DF 3 2 CA 3
And what I want to get from the output request is as follows:
field1 field2 field3 field4 1 BA 2 2 CA 3 2 DA (null) 3 DF 3
Is there any efficient way to use SQL join / filtering technology for this? Thanks
P / S - to avoid confusion, the goal is to distinguish only field1 and field2 is only that field 3 can have different values, so that the selected row is based on that row in which field4 does not have zero priority
eg.
field1 field2 field3 field4 1 BA (null) 1 BC 2 <- this will be the chosen one
source share