There are two tables Main Data and Aircraft Types. Their only common field is %Aircraft type Id, which means "type of aircraft". Main data does not contain all the types listed in aircraft types. We want to load only the types which exist in both tables.
This is how it can be done in the script editor -
LOAD AC_TYPEID as [%Aircraft Type ID],
AC_GROUP as [%Aircraft Group Type],
--------more fields here.
(txt, codepage is 1252, embedded labels, delimiter is ';', msq)
Where Exists([%Aircraft Type ID], AC_TYPEID);
My book says that WHERE EXISTS is actually checking if the %Aircraft Type ID's in Aircraft types exist in main data or not. I go to Main Data tab and see a field %Aircraft Type ID. So, I know that we are comparing [%Aircraft Type ID] of Main with AC_TYPEIDof Types.
This syntax is unintuitive. Do I have to search the script all the time to find out which table a field belongs to ?
I was hoping for syntax like this -
Where Exists([Main Data].[%Aircraft Type ID], [Aircraft Types].[AC_TYPEID]);