On Mon, Jan 15, 2018 at 7:05 AM, J Decker <d3c...@gmail.com> wrote:

>
>
> On Mon, Jan 15, 2018 at 5:14 AM, Clemens Ladisch <clem...@ladisch.de>
> wrote:
>
>> J Decker wrote:
>> > What is the expected output?
>>
>> And just out of curiosity: what should the table name be for these
>> columns?
>>
>>   SELECT articles.gmt_deleted+tags.type, 42, id FROM articles JOIN tags
>> USING (id);
>>
>>
> table name wouldn't matter.
>
> create table articles ( id, content,gmt_deleted ) " );
> create table tags ( id,type, text ) " );
> insert into articles (id,content,gmt_deleted) values ( 1, 'hello
> world','X')" );
> insert into tags (id,type,text) values ( 1, 'text', 'MOTD')" );
> SELECT articles.gmt_deleted+tags.type, 42, articles.id FROM articles JOIN
> tags on articles.id=tags.id;" ) );
> [ { '42': 42, 'articles.gmt_deleted+tags.type': 0, id: 1 } ]
>
>
SELECT * FROM articles JOIN tags USING(id)
[ { id: 1,
    content: 'hello world',
    gmt_deleted: 'X',
    type: 'text',
    text: 'MOTD' } ]

>
>> Regards,
>> Clemens
>> _______________________________________________
>> 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