= SPSS Star Join = The '''`STAR JOIN`''' command is a [[SQL]]-like left join. `STAR JOIN` is unsupported in SPSS version 20 or earlier, and completely unimplemented in PSPP. <> ---- == Usage == {{{ star join /select A.foo, A.bar, A.baz, B.ham, C.spam /from datasetA as A /join datasetB as B on A.idB = B.id /join datasetC as C on A.id = C.id and A.group = C.group /outfile file=datasetD. }}} Datasets are joined in pairs, between the `/FROM` dataset and each `/JOIN` dataset. Each pair-wise join can be done on different key variables. Within each pair-wise join, the key variables must be defined with the same [[SPSS/DataTypes|type]] in each dataset. Cases must be uniquely identified by the key variables in each dataset. While multiple key variables can be used, note that the ''only'' valid operators for the `ON` expression are `AND` and `=`. Only cases originating in the `/FROM` dataset are retained. Only variables specified on the `/SELECT` subcommand are retained. === From, Join, Outfile File === The `/FROM` subcommand, each `/JOIN` subcommand, and the `/OUTFILE FILE` subcommand all take one of: * a star (`*`) indicating the active data set * the name of a data set * a filename or [[SPSS/FileHandle|file handle]] The subcommands allow for aliases that are valid syntax in other parts throughout the command. These aliases must be unique and are bound by the same restrictions as variable names. If a single dataset is referenced on multiple `/JOIN` subcommands, they must define unique aliases. ---- == Data Model == The `STAR JOIN` command executes immediately, and reads the active dataset. Any pending transformations are executed first. ---- CategoryRicottone