On 2013.07.29 5:32 PM, Roman Fleysher wrote:
Dear SQLiters,

I think the answer to my question is "NO", but may be I missed something...

Can column name come from a table, i.e. from another select? Example:

SELECT (SELECT columnName FROM columnNameTable WHERE condition how to select 
limit 1)
FROM table which has that columnName;

Or this is not doable within SQL and I must execute internal select separately 
and have application compose second (external) select?

Thank you,

Roman

I was going to say, try using a SQL prepared statement.

For example, in Postgres you can write something like this:

  execute format( 'SELECT %I FROM table that has that columnName',
(SELECT columnName FROM columnNameTable WHERE condition how to select limit 1) );

But I don't know if SQLite can do that in SQL; you might have to use the host language.

-- Darren Duncan

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

Reply via email to