0

I am trying to implement a simple table in MS - ACCESS where im using two PK's for say a WEATHER table.

PK LOCATION
PK ID
DATE
TEMPERATURE

I wish to increment the id based on the location, so if PARIS has 2 rows then the next would be for example 3, and if there is a new entry for Location then it would be 1.

very much like this link

+--------+----+---------+
| grp    | id | name    |
+--------+----+---------+
| fish   |  1 | lax     |
| mammal |  1 | dog     |
| mammal |  2 | cat     |
| mammal |  3 | whale   |
| bird   |  1 | penguin |
| bird   |  2 | ostrich |
+--------+----+---------+  

Help greatly appreciated.

2
  • using two PK's Impossible. PK + UNIQUE - possible. Composite PK (the pair is PK whereas each single may be non-unique) - possible.
    – Akina
    Nov 3 '19 at 8:11
  • By link - it is MySQL extension. Moreover, it is specific to one engine only - to MyISAM, and is not applicable to any other engine. So it cannot be reproduced in MS Access without additional code.
    – Akina
    Nov 3 '19 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.