> > > Then I get help and this code:
> > > INSERT INTO SchoolYearTeachingDays
> > >   SELECT aDate FROM TeachingSaturdaysInSchoolYear T WHERE T.aDate
> NOT
> > > IN (SELECT S.aDate FROM SchoolYearTeachingDays S)
> >
> > This says "insert all dates that aren't already present", which of course
> avoids UNIQUE constraint.
> 
> Just do not understand what are the 'T' and 'S' means out there, after
> FROM clause.
> Are they CTEs? Are they virtual tables?
> 

They are aliases for the table names. Another way of writing this is

SELECT aDate FROM TeachingSaturdaysInSchoolYear AS T WHERE T.aDate

The AS is optional, but makes it slightly clearer that you are saying use
the table TeachingSaturdaysInSchoolYear and call it T. In this case
it is a way of saving typing.

Regards

Andy Ling
---------------------------------------------------------------------------------------
This email has been scanned for email related threats and delivered safely by 
Mimecast.
For more information please visit http://www.mimecast.com
---------------------------------------------------------------------------------------

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

Reply via email to