0
I’m making a query in my bd Sqlite, but is returning me some repeated results can not find the error.
cursor = db.Select(DataBaseHandler.TABLE_OS + " LEFT JOIN " + DataBaseHandler.TABLE_SITUACAO + " ON " + DataBaseHandler.TABLE_SITUACAO + "." + DataBaseHandler.KEY_SITUACAO_ID + "=" + DataBaseHandler.TABLE_OS + "." + DataBaseHandler.KEY_OS_SITUACAO +
" LEFT JOIN " + DataBaseHandler.TABLE_CLIENTES + " ON " + DataBaseHandler.TABLE_CLIENTES + "." + DataBaseHandler.KEY_CLIENTES_ID + "=" + DataBaseHandler.TABLE_OS + "." + DataBaseHandler.KEY_OS_CLIENTE +
" LEFT JOIN " + DataBaseHandler.TABLE_FINANCEIRO + " ON " + DataBaseHandler.TABLE_FINANCEIRO + "." + DataBaseHandler.KEY_FINANCEIRO_ID_OS + "=" + DataBaseHandler.TABLE_OS + "." + DataBaseHandler.KEY_OS_ID_SEQUENCIA +
" LEFT JOIN " + DataBaseHandler.TABLE_SERVICOS + " ON " + DataBaseHandler.TABLE_SERVICOS + "." + DataBaseHandler.KEY_SERVICO_ID_OS + "=" + DataBaseHandler.TABLE_OS + "." + DataBaseHandler.KEY_OS_ID_SEQUENCIA +
" LEFT JOIN " + DataBaseHandler.TABLE_PECAS_OS + " ON " + DataBaseHandler.TABLE_PECAS_OS + "." + DataBaseHandler.KEY_PECAS_OS_ID_OS + "=" + DataBaseHandler.TABLE_OS + "." + DataBaseHandler.KEY_OS_ID_SEQUENCIA,
null, null, null, null, null, DataBaseHandler.KEY_OS_ID_SEQUENCIA + " DESC", null);
Maybe you need some "group by" in your query. Have you checked this?
– viana
@Can you please give me an example from the code I posted?
– Emerson Barcellos