asp常用代码:ASP编程
常用的代码
疯狂代码 CrazyCoder/ :http:/CrazyCoder/
Asp/Article16017.html 大多都是平时在网上找请大家笑纳!
sql中保留字 actionaddaggregateall alterafterandas ascavgavg_row_lengthauto_increment betweenbigbitbinary blobboolbothby cas
cadecharcharacter changecheckchecksumcolumn columnscommentconstracreate crosscurrent_datecurrent_timecurrent_timestamp datadatabasedatabasesdate datetimedayday_hourday_minute day_seconddayofmonthdayofweekdayofyear decdecimaldefaultdelayed delay_key_writedeletedescdescribe distinctdistinctrowdoubledrop endescapeescaped enclosedenumexplainexists fieldsfilefirstfloat float4float8flushforeign fromforfullfunction globalgrantgrantsgroup havingheaphigh_priorityhour hour_minutehour_secondhostsidentied ignoreinindexinfile innerinsertinsert_id egererval12 348o
isisamjoin keykeyskilllast_insert_id leadingleftlengthlike lineslimitloadlocal locklogslonglongblob longtextlow_prioritymaxmax_rows matchmediumblobmediumtextmedium middlemin_rowsminuteminute_second modymonthmonthnamemyisam naturalnumericnonot nullonoptimizeoption optionallyororderouter outfilepack_keyspartialpass
word precisionprimaryprocedureprocess processlistprivilegesreadreal referencesreloadregexprename replacerestrictsrevoke rlikerowrowssecond selectshowshutdown smallsonamesql_big_tablessql_big_selects sql_low_priority_updatessql_log_offsql_log_updatesql_select_limit sql_small_resultsql_big_resultsql_warningsstraight_join startingstatustable tablestemporaryterminatedtext thentimetimestamptinyblob tinytexttinytrailingto typeuseusingunique unlockunsignedupdateusage valuesvarcharvariablesvarying varbinarywithwritewhen whereyearyear_monthzerofill
SQL常用命令使用思路方法: (1)数据记录筛选:
sql=\"select*from数据表where字段名=字段值orderby字段名\" sql=\"select*from数据表where字段名like'%字段值%'orderby字段名\" sql=\"selecttop10*from数据表where字段名orderby字段名\"
sql=\"select*from数据表where字段名in('值1','值2','值3')\"
sql=\"select*from数据表where字段名between值1and值2\" (2)更新数据记录: sql=\"update数据表字段名=字段值where条件表达式\" sql=\"update数据表字段1=值1,字段2=值2……字段n=值nwhere条件表达式\" (3)删除数据记录: sql=\"deletefrom数据表where条件表达式\" sql=\"deletefrom数据表\"(将数据表所有记录删除) (4)添加数据记录: sql=\"inserto数据表(字段1,字段2,字段3…)valuess(值1,值2,值3…)\" sql=\"inserto目标数据表select*from源数据表\"(把源数据表记录添加到目标数据表) (5)数据记录统计: AVG(字段名)得出个表格栏平均值 COUNT(*|字段名)对数据行数统计或对某栏有值数据行数统计 MAX(字段名)取得个表格栏最大值
MIN(字段名)取得个表格栏最小值 SUM(字段名)把数据栏值相加 引用以上思路方法: sql=\"selectsum(字段名)as别名from数据表where条件表达式\" rs=conn.excute(sql)
用rs(\"别名\")获取统计值其它运用同上 (5)数据表建立和删除: CREATETABLE数据表名称(字段1类型1(长度),字段2类型2(长度)……) 例:CREATETABLEtab01(namevarchar(50),datetimedefaultnow) DROPTABLE数据表名称(永久性删除个数据表) 4.记录集对象思路方法: rs.movenext将记录指针从当前位置向下移行 rs.moveprevious将记录指针从当前位