SELECT DISTINCT mt.* FROM mytable mt ; JOIN TempAcctList ON acct = acct1 ; OR acct = acct2 OR acct = acct3If table has PK field
SELECT * FROM mytable ; WHERE PK IN ( ; SELECT DISTINCT mt.pk FROM mytable mt ; JOIN TempAcctList ON acct = acct1 ; OR acct = acct2 OR acct = acct3)>I have an old DBF that I'm accessing that has account numbers stored in 9 fields, "ACCT1", "ACCT2", etc.
SELECT * From OldTable ; >where acct1 in (select * from TempAcctList) ; >or acct2 in (select * from TempAcctList) ; >or acct3 in (select * from TempAcctList) ; >... etc, through all nine accounts>I can certainly do this, but am just wondering if there's any simpler construction, or more efficient way to do this.