Small-numbers table DROP TABLE IF EXISTS numbers_small; CREATE TABLE numbers_small (number INT); INSERT INTO numbers_small VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); Main-numbers table DROP TABLE IF EXISTS numbers; CREATE TABLE number
国产著名网上商店系统,真正企业级应用软件,性能卓越,在国内外享有盛誉,用户遍布欧洲、美洲、大洋洲,支持多语言,前台与后台均可设置为不同语言界面,用户帮助文档极其丰富,PHP+MySQL+Zend运行环境,让你快速建立个性化的网上商店,内置几十种网上支付网关、内置数十套精美模板,支持实体、非实体商品销售。 更新功能调整: 1、应用中心:APP的“更新时间”字段
0
DROP
TABLE IF EXISTS numbers_small;<br>
CREATE TABLE numbers_small (number INT);<br>
INSERT INTO numbers_small VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);<br>
DROP
TABLE IF EXISTS numbers;<br>
CREATE TABLE numbers (number BIGINT);<br>
INSERT INTO numbers<br>
SELECT thousands.number * 1000 + hundreds.number * 100 + tens.number * 10 + ones.number<br>
FROM numbers_small thousands, numbers_small hundreds, numbers_small tens, numbers_small ones<br>
LIMIT 1000000;<br>
DROP
TABLE IF EXISTS Dates_D;<br>
CREATE TABLE Dates_D (<br>
date_id BIGINT PRIMARY KEY,<br>
date DATE NOT NULL,<br>
day CHAR(10),<br>
day_of_week INT,<br>
day_of_month INT,<br>
day_of_year INT,<br>
previous_day date NOT NULL default '0000-00-00',<br>
next_day date NOT NULL default '0000-00-00',<br>
weekend CHAR(10) NOT NULL DEFAULT "Weekday",<br>
week_of_year CHAR(2),<br>
month CHAR(10),<br>
month_of_year CHAR(2),<br>
quarter_of_year INT,<br>
year INT,<br>
UNIQUE KEY `date` (`date`));
INSERT
INTO Dates_D (date_id, date)<br>
SELECT number, DATE_ADD( '2010-01-01', INTERVAL number DAY )<br>
FROM numbers<br>
WHERE DATE_ADD( '2010-01-01', INTERVAL number DAY ) BETWEEN '2010-01-01' AND '2010-12-31'<br>
ORDER BY number;<br>
Change year start and end to match your needs. The above sql creates records for year 2010.
UPDATE
Dates_D SET<br>
day = DATE_FORMAT( date, "%W" ),<br>
day_of_week = DAYOFWEEK(date),<br>
day_of_month = DATE_FORMAT( date, "%d" ),<br>
day_of_year = DATE_FORMAT( date, "%j" ),<br>
previous_day = DATE_ADD(date, INTERVAL -1 DAY),<br>
next_day = DATE_ADD(date, INTERVAL 1 DAY),<br>
weekend = IF( DATE_FORMAT( date, "%W" ) IN ('Saturday','Sunday'), 'Weekend', 'Weekday'),<br>
week_of_year = DATE_FORMAT( date, "%V" ),<br>
month = DATE_FORMAT( date, "%M"),<br>
month_of_year = DATE_FORMAT( date, "%m"),<br>
quarter_of_year = QUARTER(date),<br>
year = DATE_FORMAT( date, "%Y" );
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号