Android SQLite query returning multiple same columns -
this query below in android sqlite returning multiple of same columns. example, returning "meet_id" (3) times. first (2) "meet_id" correct right number while third 1 empty. same happens "athlete_id" , "event_id". assuming because of left join since 3rd table empty of shouldn't if return 1 column each column attribute (1 meet column , more rows?):
cursor cursortemp = db.rawquery("select * " + table_meets + " left join " + table_meets_athletes + " on " + table_meets + "." + col_meet_id + " = " + table_meets_athletes + "." + col_meet_id + " left join " + table_meets_athletes_splits + " on " + table_meets_athletes + "." + col_meet_id + " = " + table_meets_athletes_splits + "." + col_meet_id + " , " + table_meets_athletes + "." + col_athlete_id + " = " + table_meets_athletes_splits + "." + col_athlete_id + " , " + table_meets_athletes + "." + col_event_id + " = " + table_meets_athletes_splits + "." + col_event_id + " " + table_meets + "." + col_meet_id + " = ?", new string[]{string.valueof(i)});
i understand bit messy raw queries more
also, meet id primary key in first table , composite in 2nd , 3rd
in instruction select * from...
, *
symbol includes columns result. resulting of multiple joins, columns repeated. suggestion replacing *
columns names of interest.
Comments
Post a Comment