I have a database like this:
So basically I want the first three fields (URL, Date and Number) to be unique, so that if URL and Date contain a value they never contained before, Number is 0, but if another row with the same URL and Date is inserted, the Number starts to increment.
This is an example of how the table should look:
I'm not really experienced in SQL, and I have no idea where to start for a query like this.
I would really like to do this in one query.
Could anyone please help me?
Thanks,
Frederik Vanderstraeten
| Quote: | ||
|
So basically I want the first three fields (URL, Date and Number) to be unique, so that if URL and Date contain a value they never contained before, Number is 0, but if another row with the same URL and Date is inserted, the Number starts to increment.
This is an example of how the table should look:
| Quote: | ||
|
I'm not really experienced in SQL, and I have no idea where to start for a query like this.
I would really like to do this in one query.
Could anyone please help me?
Thanks,
Frederik Vanderstraeten
