2009年2月24日星期二

Crosstab in MySQL

A lot of people asking me how can I do in SQL statement as Crosstab. So, here I publish the solution at here. Hope really can settle some of the person whose face the same problem.

Examples,
select "",
sum( if(so_type = "WV", invoice_amount, null) ) as wv_amount,
count( if(so_type = "WV", invoice_amount, null) ) as wv_count,
sum( if(so_type = "RW", invoice_amount, null) ) as rw_amount,
count( if(so_type = "RW", invoice_amount, null) ) as rw_count,
sum( if(so_type <> "WV" and so_type <> "RW", invoice_amount, null) ) as misc_amount,
count( if(so_type <> "WV" and so_type <> "RW", invoice_amount, null) ) as misc_count
from rbs_so
WHERE
group by ""

For more detail regarding this issue. You can get more information at here http://blog.adaniels.nl/articles/creating-a-cross-tab-in-mysql/

2009年2月1日星期日

电影与种族主义

最近有个什么部长很骄傲的说本地的电影成长迅速和多样化。还沾沾自喜的说:本地人越来越喜欢本地电影了。我想问大家,有谁花钱去戏院看过本地电影呢?老实说,我从来就没有花过一分-亳去电影院看过本地电影(我朋友也-样)。原因无它,本地电影内容不到味,粗制烂造。不是本地没有好电影,就像《最后一个共产》就是-部不错的电影。还过这部电影无法在本地电影院无法上映。只因我们伟大的电俭局而无法上映。

谈了这么多,还没有说到电影和种族主义有何关连。不知道大家知不知道 ,政府为了鼓劢本地的电影发展。实施了扣税方案。那如何来鉴定一部电影是不是本地电影呢?看我们的官员如何定义。他们是以一个特定的语言来决定的。只要你的电影里,有-点点其它语言的全在,就不是本地电影,那你的电影就没能得到回扣税了。


种族主义的侵入是电影界的悲哀呀!那为何没有人反对呢?有如教育界里反对单-语言一般呢?我想,那是因为大多数人认为,教育是大事,而电影是小事吧!