SELECT * FROM sp INTO TABLE (cMytemptab) ; INNER JOIN splink ON sp.spcode = splink.spcode ; WHERE &customwhereAlternatively, you can put it all in the WHERE and FROM clauses, although the syntax above is more standard and more portable to other database systems. In this case, an INNER JOIN is implied:
SELECT sp.* FROM sp, splink INTO TABLE (cMytemptab) ; WHERE sp.spcode = splink.spcode ; AND &customwhere>I am converting all my home-written queries into SQL. I am learning that I have to think differently! e.g. SQL does not respect normal filters. I also realise that my table relations are ignored in where clauses.