一个查询语句问题
已知表:id time
1 2007-10-20 9:30:02
2 2008-11-20 9:30:02
3 2008-10-20 9:30:02
4 2009-2-20 9:30:02
.........
想得出下面的表,weekdays是time里的月份里所包含周末的天数,即当月周六和周日一共的天数
id time weekdays
1 2007-10-20 9:30:02 8
2 2008-11-20 9:30:02 10
3 2008-10-20 9:30:02 8
4 2009-10-20 9:30:02 9
.........