MS Access - Making two columns with duplicate entry as one unique Composite Primary key -


i trying develop database store energy related data. basically, have 4 columns

 1. entity name:            text format 2. time-date:              dd/mm/yyyy hh:mm format 3. value:                  number 0.00 format 4. description:            text format 

e.g.

 main_meter_kwh | 29/04/2015 00:30 | 30.00 | mains meter energy reading main_meter_kwh | 29/04/2015 01:00 | 20.00 | mains meter energy reading main_meter_kwh | 29/04/2015 01:30 | 25.00 | mains meter energy reading main_meter_kwh | 29/04/2015 02:00 | 32.00 | mains meter energy reading hvac_meter_kwh | 29/04/2015 00:30 | 30.00 | hvac meter energy reading hvac_meter_kwh | 29/04/2015 01:00 | 20.00 | hvac meter energy reading hvac_meter_kwh | 29/04/2015 01:30 | 25.00 | hvac meter energy reading hvac_meter_kwh | 29/04/2015 02:00 | 32.00 | hvac meter energy reading 

so can see, issue want create composite primary key using col 1 & 2 i.e. entity name , date-time. both columns have duplicates values.

therefore, want know if can create composite primary key combination of col 1 & 2 unique individually accept duplicate values.

look forward hear wise minds!!!

thanks in advance.

there no problem duplicate values in individual columns of multi-column primary key, provided primary key not contain duplicate values across columns. primary key on ([entity name], [time-date]) fine sample data in question because though there repeated values in [entity name] column , repeated values in [time-date] column there no rows both values identical.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -