1
如何將此SQL查詢轉換爲Perl DBIx::Class代碼?如何使用COUNT,SUM,CASE和BETWEEN將此SQL查詢轉換爲Perl DBIx :: Class?
SELECT COUNT(*) AS num_grads,
SUM(CASE WHEN employment_status = 1 THEN 1 ELSE 0 END) AS num_employed
FROM students
WHERE status = 6 -- 6 means they graduated
AND grad_date BETWEEN Convert(datetime, ?) AND Convert(datetime, ?)
你的意思是DBIx :: Class? – 2011-01-19 16:53:11
是的,DBIx :: Class。 – Justin 2011-01-19 21:48:23