nick huang wrote:
> You are absolutely right that its type is NULL and min(id) returns 0 as I use 
> sqlite_column_int64 to retrieve data. However,
> isn't it confusing that the "sqlite3_step" returns SQLITE_ROW which usually 
> means some dataset is returned?

A resultset consisting of one row is indeed being returned. What's confusing 
about this?

> I mean, if it returns
> one NULL row, why doesn't sqlite simply return "SQLITE_DONE" or something 
> instead of "SQLITE_ROW"?

An empty resultset and a resultset with one row that just happens to have NULLs 
in all columns are two entirely different things. Compare and contrast:

select count(*) from (select id from url);

select count(*) from (select min(id) from url);

> You see, as user I have to
> double-check its return type even after I get "SQLITE_ROW". In this sense, I 
> think it is a bug.

Can you perhaps point to a clause in SQL-92 standard that SQLite violates here?

A query involving an aggregate function without a GROUP BY clause always 
returns exactly one row. This is how SQL works.

Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to