MySQL常用语句

2015-09-01

SELECT UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`updateTime`) * FROM `table`;
SELECT '' `myColumn` FROM `myTable`;
SELECT 'myValue' `myColumn` FROM `myTable`;
INSERT INTO `table` VALUES(UUID());
UPDATE `table1` SET `column1` = CONCAT('http://zhso.net', `column1`);
SELECT * FROM `table1` WHERE LENGTH(`column1`) > 10;
UPDATE `table1` SET `column1` = REPLACE(`column1`,'100','10');
SELECT COUNT(*) FROM `table1`
1
2
3
SELECT * FROM `table1` WHERE `column1` IN (
  SELECT `column1` FROM `table1` GROUP BY `column1` HAVING(COUNT(*)) > 1
)

s@zhso.netPay