Category: sql

Using Autonumbering in Access – INSERT statements

I’m having trouble running an INSERT statement where there’s an autonumber as the PK field. I have an Auto-incrementing long as the Primary Key, and then 4 fields of type double; and yet Access (using ADO) seems to want five values for the insert statement. INSERT INTO [MY_TABLE] VALUES (1.0, 2.0, 3.0, 4.0); >> Error: […]

SQL to join one table to another table multiple times? (Mapping products to categories)

Let’s say I have a Product, Category, and Product_To_Category table. A Product can be in multiple categories. Product Category Product_to_category ID | NAME ID | Name Prod_id | Cat_id ===================== ============ =================== 1| Rose 1| Flowers 1| 1 2| Chocolate Bar 2| Food 2| 2 3| Chocolate Flower 3| 1 3| 2 I would like […]