我有一個表銷售訂單結構: - ItemID
- Customer
- Year
- Month
- Quantity
我要建立報告,如: Customer | Item | Year | Month | Quantity | The same month of the previous year quantity|
能否請你幫我。 謝謝。
早上好,關於使用SQL創建報告的問題。花了一些時間試圖找出如何做到這一點。因此,這裏的代碼... select
c.searchname as 'Client Name',
w.Date as 'Date',
j.Name as 'Engagement Name',
j.JobID as 'Eng #',
sum(units) as 'Hours',
ca.Description as
我正在制定分別爲每個1,3,6,12和24個月生成報告的要求,其中用戶通過選擇下拉列表選擇他的選擇。首先我寫了查詢來生成1個月的報告,這很好。但我不確定如何根據用戶選擇使選擇動態化。 我的查詢低於: switch($months){
case "1":
$stmt = $pdo->prepare("SELECT count(*) as totalrows FROM today