Actually, you would probably write:

SELECT aDate
  FROM TeachingSaturdaysInSchoolYear
 WHERE aDate NOT IN (SELECT aDate
                       FROM SchoolYearTeachingDays);

Since the subquery is not correlated there is no *need* for aliases ... but if 
you want to type more characters you are free to do so ...

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.

>-----Original Message-----
>From: sqlite-users [mailto:sqlite-users-
>boun...@mailinglists.sqlite.org] On Behalf Of Simon Slavin
>Sent: Tuesday, 26 June, 2018 08:56
>To: SQLite mailing list
>Subject: Re: [sqlite] Understanding SELECT statement
>
>
>
>> On 26 Jun 2018, at 3:42pm, Csányi Pál <csanyi...@gmail.com> wrote:
>>
>>>> INSERT INTO SchoolYearTeachingDays
>>>>  SELECT aDate FROM TeachingSaturdaysInSchoolYear T WHERE T.aDate
>NOT
>>>> IN (SELECT S.aDate FROM SchoolYearTeachingDays S)
>>
>> Just do not understand what are the 'T' and 'S' means out there,
>after
>> FROM clause.
>
>This is from an old stupid syntax for SQL.  In more modern SQL we
>would write
>
>    SELECT aDate FROM TeachingSaturdaysInSchoolYear AS T WHERE
>T.aDate NOT IN (SELECT S.aDate FROM SchoolYearTeachingDays AS S)
>
>It works for backwards compatibility but the "AS" makes the sense
>clearer.
>
>Simon.
>_______________________________________________
>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