Reputation: 2824
We are building an invoice management app and need help/suggestions with the following...
We want your suggestions to achieve this. thanks.
Upvotes: 2
Views: 76
Reputation: 125304
Create the primary key as in heximal's answer. Then use this to insert a new id:
insert into my_table (id, year)
values (
coalesce (
(
select new_id = max(id) + 1
from my_table
where year = @year
), 1)
, @year
)
Upvotes: 1
Reputation: 360732
select ... where date_of_record between $start_of_period and $end_of_period
.Upvotes: 1