开发者

Android: Error in Cursor.getColumnNames on froyo

In versions 1.6 and 2.1 android getColumnNames function returns me an array of field names + aliases? Why?

for example.

SELECT c.idCliente, c.nombre,COUNT(cab.idcomprobante) AS cbtes FROM Customers AS c LEFT JOIN AS cab Headers ON c.idCliente=cab.idCliente

with this query getColumnNames function () returns an array:

"c.idCliente"
"c.nombre"
"cbtes"

Why the alias is in front?

in version 2.2 of android, the same array have the following values.

"idCliente"
"nombre"
"cbtes"

this is the right thing ... but obviously throw an error and can not find the name of the column in the array.

wonder if the solution to this problem is the following:

SELECT c.idCliente AS idCliente,c.nombre AS nombre,COUNT(cab.idcomprobante) AS cbtes FROM Clientes AS c LEFT JOIN Cabeceras AS cab ON c.idCliente = cab.idCliente

with the "开发者_JAVA技巧AS" in every field?


my friend "AS" not support to squlite
you wont to both table comen data that to try to compare single single query to compare that one possible

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜