tags:

views:

115

answers:

1

I need to join an existing table with date entries with a list of months in a given period. For this I would need to temporary generate a list of months within this period.

Is there a command in mysql for doing this? Temporary Table, stored procedure?

Thx, martin

+1  A: 

I'm not sure I fully understand your question, but something like this might be what your looking for:

select * from existing_table et join month_table mt on mt.month = month(et.date)

+1 Yes, the easiest solution is to create a 12-row table containing month names.
Bill Karwin