|
Posted by Chung Leong on 10/24/06 13:46
Daz napisal(a):
> I can't use any unique keys on my table, as each user can have 'up to'
> 3600 items, and a row is added for each item the user has, in the user
> table. For example:
>
> +-----+---------+
> | uid | item_id |
> +-----+---------+
> | 3 | 1 |
> | 3 | 3 |
> | 3 | 5 |
> | 3 | 6 |
> | 3 | 7 |
> | 3 | 9 |
> | 3 | 12 |
> | 3 | 13 |
> | 3 | 15 |
> | 3 | 16 |
> +-----+---------+
>
> If a row doesn't exist, then a user doesn't own the item.
I'm not terribly familiar with MySQL. I think it supports multi-column
unique constraint. So in your case, you're force the uid + item_id
combination to be unique.
Navigation:
[Reply to this message]
|