Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÀûÓÃSQL²éѯ²åÈëÊý¾Ý

ÈçºÎ½«sql²éѯ½á¹û£¨²»Ö¹Ò»Ï²åÈëµ½Ò»ÕűíÖУ¬ÎÒÃÇÒ»°ã¿ÉÒÔÓÃÈçÏÂÐÎʽµÄsql
insert into table1
select field1,field2,... from table2
where ... 
ËüÒªÇó¶ÔÓ¦µÄ²åÈëÏîÀàÐͱØÐëÒ»Ö¡£
ÁíÍ⣬µ±selectµÄ²éѯ½á¹ûÊÇtable1µÄËùÓÐ×ֶεÄʱºò£¬¿ÉÒÔÊ¡ÂÔtable1µÄÁÐ×ֶΣ¬Ð´³ÉÈçÏÂÐÎʽ£º
insert into table1(field1,field2,...)
select field1,field2,... from table2
where ...
ÔÚʵ¼Êµ±ÖÐÎÒÃÇ¿ÉÄÜÓöµ½ ½øÐÐ±íµ¥ÌÊý¾Ýʱ,Õâʱ±íµ¥ÀïÃæµÄÖµÊDZäÁ¿
strSql.Append("insert into tny_surveyArea(");
                        strSql.Append("surveyAreaId,TaskID,biologyId,biologyType,generationId,wormAgeId,statusId,damageCodeId,occurArea,deadTreeCount,Remark,SurveyTypeId,SurveyDate,surveyUserID,inputUserId,CheckStatus,GPSCoor,IsCheckData,SmallFieldID,Geometry, Geometry_XLO, Geometry_YLO, Geometry_XHI, Geometry_YHI");
                        strSql.Append(")");
                        strSql.Append(" select ");
                        strSql.Append("'" + model.surveyAreaId + "',");
                        strSql.Append("" + model.TaskID + ",");
                        strSql.Append("'" + model.biologyId + "',");
                        strSql.Append("'" + model.biologyType + "',");
  &nb


Ïà¹ØÎĵµ£º

JSPʵÀýÈý¡¢sql·ÖÒ³(1)

index.jsp
<%@ page language="java" import="java.sql.*" import="java.lang.*" import="java.util.*" pageEncoding="GB2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%!
& ......

½â¾öSQL ServerתACCESS×Ô¶¯±àºÅÎÊÌâ


1.´ò¿ªSQL server enterprise mananger “ÆóÒµ¹ÜÀíÆ÷”
ÔÚÄãÒªµ¼³öµÄSQLÊý¾Ý¿âÉÏÊó±êÓÒ¼ü²Ëµ¥£ºËùÓÐÈÎÎñ-¡·µ¼³öÊý¾Ý
2.»Ø³öÏÖÒ»¸öµ¼³öÏòµ¼´°¿Ú¡£
Ñ¡Ôñ±»µ¼³öµÄÊý¾ÝÔ´£¬ÎªÄã¸Õ²ÅËùÑ¡ÔñµÄÊý¾Ý¿â£¬Èç¹û·¢ÏÖ²»¶ÔÓ¦×ÔÐÐÐ޸ġ£
3.½øÈëµ¼³öµ½Ä¿±êÊý¾ÝÔ´µÄÑ¡Ôñ£¬ÕâÀïÎÒÃÇҪת³ÉACCESSµÄÊý¾Ý¿â¡£×¢ÒâÑ¡ÔñÊý¾ÝÔ´ÀàÐÍÎ ......

SQL SERVER±í¼ä¸´ÖÆÊý¾Ý

Select * into customers from clients
(Êǽ«clients±íÀïµÄ¼Ç¼²åÈëµ½customersÖУ¬ÒªÇó£ºcustomers±í²»´æÔÚ£¬ÒòΪÔÚ²åÈëʱ»á×Ô¶¯´´½¨Ëü£»)
Insert into customers select * from clients
½â£ºInsert into customers select * from clients£©ÒªÇóÄ¿±ê±í£¨customers£©´æÔÚ£¬
ÓÉÓÚÄ¿±ê±íÒѾ­´æÔÚ£¬ËùÒÔÎÒÃdzýÁ˲åÈëÔ´±í£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ