BundleID | ProductID| OrderNum
--------------------------------
1 | 1 | 1
1 | 2 | 2
2 | 1 | 1
2 | 2 | 2
Query Code :
SELECT COUNT(*) FROM table WHERE table.bundle_id = 2;
What I would like to do here is to add a new record (BundleID, ProductID, OrderNum), Where both BundleID & ProductID are pre-determined while the OrderNum will be the count + 1 (This is a music play list and I'm wondering if this is the best way to do it).
I've tried to figure out functions in postgres but I've got no progress with it.
Are they any tutorial which is easy to understad?