First of all i want to sorry of my english. Now i will explain what problem do i have.
I have 2 tables, in first table i write book code and this book copy codes, like this:
books table:
Code: Select all
book_id
book_copy_id
other info...Code: Select all
book_id | book_copy_id
1 | 100
1 | 101
1 | 102
2 | 103
2 | 104
etc..orders table:
Code: Select all
order_id
user_id
book_id
stausmy problem is: i whant to count how many users wants one book and count how many copys i have (hope you understand me