Re: [sqlite] Unexpected result from SELECT * FROM (subquery);

2017-11-05 Thread Klaus Maas
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

Re: [sqlite] Unexpected result from SELECT * FROM (subquery);

2017-11-05 Thread Peter Da Silva
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';",

Re: [sqlite] Unexpected result from SELECT * FROM (subquery);

2017-11-05 Thread Klaus Maas
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? email signature Klaus Maas Klaus On

Re: [sqlite] Unexpected result from SELECT * FROM (subquery);

2017-11-05 Thread Peter Da Silva
On 2017-11-05, at 05:28, Klaus Maas wrote: > I thought it was because what SQL returns is a value (in this case a string) > and not an object? > > The string value might be the same as the name of an object, but is not the > object. Select returns a table, not a name or a

Re: [sqlite] Unexpected result from SELECT * FROM (subquery);

2017-11-05 Thread Klaus Maas
I thought it was because what SQL returns is a value (in this case a string) and not an object? The string value might be the same as the name of an object, but is not the object. email signature Klaus Maas Klaus On

Re: [sqlite] Unexpected result from SELECT * FROM (subquery);

2017-11-05 Thread Richard Hipp
On 11/5/17, Shane Dev wrote: > > In sqlite3, I executed the following statements - > > sqlite> select name from tabs where rowid=1; > tab1 > sqlite> select * from tab1; > first rec > > sqlite> select * from (select name from tabs where rowid=1); > tab1 > > I expected the