SQL查询语句,纵横表查询,难度极高
date bid eid kid pid
2013-01-020000300002000900002600005000020000100039
2013-01-020000300002000900002600005000020000100038
2013-01-0200005 0002600005000010000200006
2013-01-0200005 0002600005000040000100013
2013-01-0300005 0001700005000020000100027
2013-01-0300005 0000700005000130000400010
2013-01-0300005 0000700005000130000400006
2013-01-0300005 0000700005000110000400006
2013-01-0300005 0000700005000090000100014
2013-01-0300005 0000700005000130000400003
2013-01-0300005 0000700005000130000400006
2013-01-0300005 0000700005000130000400001
2013-01-0300005 0000700005000110000400006
2013-01-030000200006000660002600005000040000500006
2013-01-040000300007001190000700005000070000600001
2013-01-040000300007001190000700005000110000600020
2013-01-040000300007001190000700005000070000600020
2013-01-040000300007001190000700005000080000500017
2013-01-050000200003000510002600005000130000700012
2013-01-050000200003000510002600005000130000700009
Select date,Count(distinct bid),Count(distinct eid),Count(distinct kid),Count(pid) From table1 group by date