MySQL ????????????
???????????? ???????[ 2015/8/10 11:21:56 ] ????????????? ???????????
???????????
????MySQL??????????????????????к????????
????????????????????????????
????CREATE TABLE `myIndex` (
????`i_testID` INT NOT NULL AUTO_INCREMENT??
????`vc_Name` VARCHAR(50) NOT NULL??
????`vc_City` VARCHAR(50) NOT NULL??
????`i_Age` INT NOT NULL??
????`i_SchoolID` INT NOT NULL??
????PRIMARY KEY (`i_testID`)
????);
???????????????1000??????????? 10000 ????????? 7 ?? 8 ?μ????? 5 ?? vc_Name=”erquan” ??????????? city??age??school ????????????????????? T-SQL??
????SELECT `i_testID` FROM `myIndex` WHERE `vc_Name`='erquan' AND `vc_City`='???' AND `i_Age`=25; -- ????????;
????????????MySQL??????????
?????? vc_Name ?????????????????? T-SQL ???MYSQL ?????????????? vc_Name=erquan ?? 5 ??????????????????м?????????????????????????? vc_City ??????”???”??????????? i_Age ?????? 25 ???????????????????????????????? vc_Name ?????????????????MYSQL?????????????Ч???????????????????????????????????????? vc_City ?? i_Age ???????MySQL??????????Ч???????
????????????? MySQL ??Ч??????????????????????? vc_Name??vc_City??i_Age ?????????????
????ALTER TABLE `myIndex` ADD INDEX `name_city_age` (vc_Name(10)??vc_City??i_Age);
???????????vc_Name ????? 50??????????? 10 ????????????????????????????????????????????????? 10???????????????????????????????????????С????? INSERT ?????????
??????? T-SQL ???MySQL ????????κμ???????????!!
???????????? vc_Name??vc_City??i_Age ????????????????????? 3 ???????????????????????????????Ч?????????????????????????????????????????????????????????? ?? MySQL ?????????е????????????????Ч???????????????????????ò??????????????????????????? ??
??????????????????????????????????????
????vc_Name??vc_City??i_Age
????vc_Name??vc_City
????vc_Name
?????????????????????!?????? vc_City??i_Age ????????????????????????? mysql ??????? “????” ??????????????????????????????????????????????е????????????????????????????? T-SQL ???????
????SELECT * FROM myIndex WHREE vc_Name=”erquan” AND vc_City=”???” SELECT * FROM myIndex WHREE vc_Name=”erquan”
?????????漸???????????
????SELECT * FROM myIndex WHREE i_Age=20 AND vc_City=”???” SELECT * FROM myIndex WHREE vc_City=”???”
????????name_city_age(vc_Name(10)??vc_City??i_Age) ????????????????????????????Mysql????????????
??????????
????????????г???????????????????????????????????????????????????????????????????????????????????????????????????????0.31????????(???????????????)
????SELECT COUNT(DISTINCT(LEFT(`title`??10)))/COUNT(*) FROM Arctic; — ????????0.31???????????????Distinct???? ALTER TABLE `user` ADD INDEX `uname`(title(10)); — ??????????SQL????????????????????10??????????????????????С???????????????
??????????sql????????
???????????????Щ??????????sql
????SELECT `sname` FROM `stu` WHERE `age`+10=30;-- ?????????????????????????в????????
????SELECT `sname` FROM `stu` WHERE LEFT(`date`??4) <1990; -- ????????????????????????????????????????
????SELECT * FROM `houdunwang` WHERE `uname` LIKE'???%' -- ??????
????SELECT * FROM `houdunwang` WHERE `uname` LIKE "%???%" -- ????????
????-- ??????????????????????ú??????????????SQL?к??????regexp?????????
????-- ?????????????????????;
????CREATE TABLE `a` (`a` char(10));
????EXPLAIN SELECT * FROM `a` WHERE `a`="1" -- ??????
????EXPLAIN SELECT * FROM `a` WHERE `a`=1 -- ????????
????select * from dept where dname='xxx' or loc='xx' or deptno=45 --???????????or????????????????????????????á???????????????????????Σ??????????????? ???????????????????or ?????
????-- ???mysql??????????????????????????????????
?????????????????Ч??
????SELECT `sname` FROM `stu` WHERE LEFT(`date`??4) <1990; — ????????????????????????????????????????
????SELECT * FROM `houdunwang` WHERE `uname` LIKE’???%’ — ??????
????SELECT * FROM `houdunwang` WHERE `uname` LIKE “%???%” — ????????
?????????????????????б??type?all????????????;???6 6 6?????????????216??;
????????????????????(???????????????????)????????range(??????????)?????6+1+1+1???????????9?μ???;
???????????????????join?????????join????????????С?????????????????????裬????????????龡?????left join???????????.??????join ???????????????????????????????????????????????.
????????????
???????????????????????????????????д?????????????????????????????????????????????????????????2?????????????????Щ??????????????????????????????????;
????????????????????У???????????????DML????????????????80%~90%??????????????????????????????????????????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11