On May 18, 2009, at 2:53 PM, Pavel Ivanov wrote:

> Actually I wanted to know if it can be useful somewhere. :-)

I already shown you one useful thing to do with a SELECT that omits  
the FROM clause:  Determine the version of SQLite you are running  
using "SELECT  sqlite_version()".

In applications I write, I typically have an SQLite database  
connection open and the infrastructure in place to get query results  
easily, and so I find queries such as the following to be useful and  
convenient:

     SELECT datetime('now');    -- Get the current date and time in  
IS0-8601

     SELECT lower(hex(randomblob(32)));  -- Get a universally unique  
identifier

The original reason that SELECT without FROM was added is so that one  
could invoke application-defined functions, or the RAISE() function,  
from within triggers:

     CREATE TRIGGER ex1 AFTER UPDATE ON table1 BEGIN
         SELECT do_something_using_c_code();
     END;

D. Richard Hipp
d...@hwaci.com



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

Reply via email to