so I hace 3 tables:
proveedor: _id descripcion
almacen: _id descripcion
Cab_ing _id descripcion cod_proveedor cod_almacen FOREIGN KEY(cod_proveedor) REFERENCES proveedores(_id) FOREIGN KEY(cod_almacen) REFERENCES almacenes(_id)
when I execute this query:
c = db.rawQuery(
" SELECT "
+ "a."+KEY_ROWID + " AS _id,"
+ "a.cod_agencia AS cod_agencia" + ","
+ "a.fecha AS fecha" + ","
+ "b.descripcion AS cod_proveedor" + ","
+ "c.descripcion AS cod_almacen" + ","
+ "a.estado AS estado" + ""
+ " FROM "
+ "cab_ings a, proveedores b, almacenes c"
+" WHERE a.cod_proveedor = b._id AND a.cod_almacen = c._id",null);
it doesn't show anything but WHEN I chance de "b._id" to '0' for example it shows. I dunno why, but I think is the reference problem.
EDIT:
I want the value (descripcion) of both tables thats why I use the traditional query a.id1 -> b.id AND a.id2 -> b.id
Proveedor table
ID descripcion
1 R*1005
2 R*10335
Almacen table
ID descripcion
3 a*10
6 a*12
Cab_ing table
ID cod_proveedor cod_almacen
1 1 3
2 2 3