Maxrem Maxrem - 13 days ago 5
SQL Question

How can I update column values from one table with unique values from another?

I have 2 tables T1 and T2 and need to update T2.F with unique values from T1.F

How can I do this in Microsoft Access 2013 through SQL or VBA currentdb.execute?

T1.F T2.F
A A
A B
B
B
B
C
C
C
C

Answer
INSERT INTO T2(F)
SELECT DISTINCT T1.F
FROM T1
  • T2(F) - F is your column name in table T2.
  • SELECT DISTINCT gets the different values in T1.F (A, B, C, etc)
Comments