Total_Sales 表格 Name Sales John 10 Jennifer 15 Stella 20 Sophia 40 Greg 50 Jeff 20 要算出累積總計,我們就鍵入以下的 SQL 語句: SELECT a1.Name, a1.Sales, SUM(a2.Sales) Running_Total FROM Total_Sales a1, Total_Sales a2 WHERE a1.Sales <= a2.Sales OR (a1.Sales=a2.Sales AND a1.Name = a2.Name) GROUP BY a1.Name, a1.Sales ORDER BY a1.Sales DESC, a1.Name DESC; 結果: Name Sales Running_Total Greg 50 50 Sophia 40 90 Stella 20 110 Jeff 20 130 Jennifer 15 145 John 10 155 var sql = SELECT a1.Name, a1.Sales, SUM(a2.Sales) Running_Total FROM ? a1, ? a2 WHERE a1.Sales <= a2.Sales OR (a1.Sales=a2.Sales AND a1.Name = a2.Name) GROUP BY a1.Name, a1.Sales ORDER BY a1.Sales DESC, a1.Name DESC; " Com_data = alasql(sql, [ Total_Sales , Total_Sales ])
ui={ view : "datepicker" , id : "Date" , labelWidth : 35 , format : "%Y-%m-%d" , width : 250 , }, var myformat = webix . Date . dateToStr ( "%Y-%m-%d" ); //時間的形式 var date = myformat ( new Date ()); //當天時間的轉換 $$ ( "Date" ). setValue ( date ); //產生新的時間 webix . Date . add(當天 日期,數量,單位) var weekdate = webix . Date . add ( new Date (), - 1 , "week" ) var monthdate = webix . Date . add ( new Date (), - 1 , "month" ) //修改時間格式 var weekdate = myformat ( webix . Date . add ( new Date (), - 1 , "week" )) var monthdate = myformat ( webix . Date . add ( new Date (), - 1 , "month" )) //取得時間的字串 var daystr= $$ ( 'Date' ). data . text; //day的型態是String //將字串轉成時間 var day = new Date ( daystr ); // Thu Jun 04 2020 08:00:0...
From the Command Line Use the following command to check the version of your local MySQL server. This command is not specific to any operating system. This command is compatible with all Linux, Windows, and macOS versions running MySQL. mysql -V Here is the output. # mysql -V mysql Ver 14.14 Distrib 5.7.15, for Win32 (AMD64) SELECT VERSION Statement Use the SELECT VERSION() command in the MySQL database client to check the MySQL version. SELECT version(); Here is the output. MariaDB [***]> SELECT version(); +-----------------+ | version() | +-----------------+ | 10.3.37-MariaDB | +-----------------+ 1 row in set (0.000 sec)
留言
張貼留言