The table contains a single row with a single column that contains a string.
Like this explanation. Much better than my attempt.

What the outer select sees in its from clause is an ["unnamed-table"] that [contains one row containing 'tab1'].

Thank you for pushing this point.

The point I was trying to make and obviously failed was that the string returned by the select statement nested in the from clause is just a string which happens to be the same text as the name of a table.
Looking the same does not make it the same.

Klaus
email signature Klaus Maas
------------------------------------------------------------------------
On 2017-11-05 14:20, Peter Da Silva wrote:
The table contains a single row with a single column that contains a string.

That doesn't make it a string. It's still a table. When you say "select ... from table" it doesn't matter 
where the table came from, it's still an operation on a table. You are not performing "select ... from 
'tab1';", you're performing "select ... from unnamed-table" where "unnamed-table" contains one 
row containing 'tab1'.

The result of *that* select is yet another unnamed table that the sqlite3 shell 
displays for you.

Even if you perform

        select * from (select * from (select * from ( ... ) )

The result is still a table. Select is not an indirection operator like 
accessing an element of an array or a structure.

On 2017-11-05, at 05:39, Klaus Maas <k...@maasser.eu> wrote:
Yes, correct.

But the contents of the returned table are not objects, but merely values.

In this case the returned table contains a single string value .... which 
happens to be the name of a table, but it is not the table.

Or do I get this wrong?
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

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

Reply via email to