Android Question need help for SQL Query

mw71

Active Member
Licensed User
Longtime User
Hi,

with this Query
SELECT Call As [Call], Band As [Band], vom As [vom], zum As [zum], id FROM Log WHERE (vom <>'' AND zum <>'' ) COLLATE NOCASE

result is:
AA 2 Wind Götzing
AA 7 Wind Götzing
AA 7 Wind Unger
BBBB 2 Wind Heinrich
BBBB 7 Wind Heinrich
CCCCC 2 Busch luna
CCCCC 2 Wind luna
CCCCC 7 Wind luna
DDDD 2 Wind luna
DDDD 7 Wind luna
FF 2 Wind Lerche
FF 7 Wind Lerche
EEE 2 Wind luna
EEE 7 Wind luna

i need ab Query whith this Result:
AA 2 Wind Götzing
AA 7 Wind Unger
BBBB 2 Wind Heinrich
CCCCC 2 Busch luna
CCCCC 2 Wind luna
FF 2 Wind Lerche

I only need one (the first) result for the pairing "von" and "zum", regardless of volume and call. For example, CCCCC, DDDD and EEE worked from Wind to Luna on 2 and 7, I only need CCCC on 2.

thank you for help
 

keirS

Well-Known Member
Licensed User
Longtime User
B4X:
SELECT  min(Call) as Call, min(Band) as Band, vom, zum FROM Log group by vom,zum order by vom,zum
 
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
B4X:
SELECT DISTINCT Log.vom AS vom, Log.zum AS zum FROM Log

But that will not return Call or Band...
 
Upvote 0

mw71

Active Member
Licensed User
Longtime User
thanks all,

GROUP Work fine. At the moment i cant use the MIN statement, but this is a "Problem" in the App process.


ps: the Query i have Post generate a Table View in the Table Class, the first query i have Write
 
Upvote 0
Top