sqlserver 执行SQL异常:从 varchar 数据类型到 datetime 数据类型的转换产生一个超出范围的值

SQL如下:

select * from cbnb_hl where hbmc = '美元' and fbsj = cast('2207.11.06 50:00:03' as datetime)

fbsj字段类型为datetime

sql

1个回答

小时字段为50超出24了,所以报错。。。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
[Microsoft][ODBC Driver 11 for SQL Server][SQL Server]在将varchar 值'初始状态'转换成数据类型int时失败要怎么解决?

insertStr = "insert into "+ tableName +" (RELATION_ID,ORGANIZATION_ID,SAMPLE_NO,LOT_NAME,ITEM_CODE,QUANTITY,C_SMPL_VOLUME,C_SAMPLE_UNIT,C_AGENCY,SUPPLIER_LOT,C_MATERIAL_SOURCE,SPEC_ID,GRADE,NUM_CONTAINERS,SPEC_VERS,C_PACK_SPEC,C_SPEC,C_STORAGE_CONDITION,C_TEST_PREPOSE,C_LOT_STATUS,C_MANUFACTURER,PRODUCTION_DATE,T_PH_RETEST_DATE,EXPIRY_DATE,CREATELOT_STATUS,RESULT_STATUS,SEQ,TEST_ID, " insertStr = insertStr + "RESULT_ID,TEST_DESC,TEST_UNIT,CHECK_ITEM,CHECK_RESULT,TYPE_SEQ,TYPE_CODE,C_ERP_COMMENT,C_REAGENT_GRADE, CREATE_ON)" insertStr = insertStr + " VALUES ('"+ xmlArrRet[1,1] +"','"+ xmlArrRet[1,2] +"','"+ xmlArrRet[1,3] +"','"+ xmlArrRet[1,4] +"','"+ xmlArrRet[1,5] +"','"+ xmlArrRet[1,6] +"','"+ xmlArrRet[1,7] +"' " insertStr = insertStr + " ,'" + xmlArrRet[1,8] +"','"+ xmlArrRet[1,9] +"','"+ xmlArrRet[1,10] +"','"+ xmlArrRet[1,11] +"','"+ xmlArrRet[1,12] +"','"+xmlArrRet[1,13]&"_"&xmlArrRet[1,15] +"','"+xmlArrRet[1,14] +"','"+xmlArrRet[1,15] +"','"+ xmlArrRet[1,16] +"','" + xmlArrRet[1,17] +"','" + xmlArrRet[1,18] +"','"+ xmlArrRet[1,25] +"','" + xmlArrRet[1,26] +"','"+ xmlArrRet[1,27] +"','"+ xmlArrRet[1,19] +"','" + xmlArrRet[1,20] +"','" + xmlArrRet[1,21] +"','" + xmlArrRet[1,28] +"','" + xmlArrRet[1,29] +"','" + "初始状态"+"','" + "初始状态"+"','"+ xmlArrRet1[a,1] +"','"+ xmlArrRet1[a,2] +"' " insertStr = insertStr + " ,'" + xmlArrRet1[a,3] +"','"+ xmlArrRet1[a,4] +"' ,'"+ xmlArrRet1[a,5] +"','"+ xmlArrRet1[a,6] +"','"+ xmlArrRet1[a,7] +"','"+ xmlArrRet1[a,8] +"','"+ xmlArrRet1[a,9] +"' " insertStr = insertStr + ",SYSDATETIME() ) " status = SQL(insertStr) IF (status) THEN MsgBox("中间表数据写入成功",100) ELSE MsgBox("中间表数据没有更新",100) ENDIF NEXT

(SQL SERVER存储过程)将查询的数据放到另外一张表的字段里,仅此而已

``` ALTER PROCEDURE [dbo].[bb_sx_sclr] @KSRQ varchar(20), --开始时间 @JSRQ varchar(20) --结束时间 AS BEGIN DECLARE @DATE_S DATETIME,@DATE_E DATETIME --定义时间格式的日期变量 DECLARE @DATE_TMP DATETIME --交换日期用的临时变量 BEGIN TRY --开始校验输入是否合法 SET @DATE_S =CONVERT(DATETIME,@KSRQ) --转换输入的字符串日期到时间格式的变量 SET @DATE_E =CONVERT(DATETIME,@JSRQ) --转换输入的字符串日期到时间格式的变量 IF @DATE_S>@DATE_E --如果开始日期大于结束日期,则交换,允许用户输入日期大小相反 BEGIN SET @DATE_TMP=@DATE_S SET @DATE_S=@DATE_E SET @DATE_E=@DATE_TMP END END TRY BEGIN CATCH --错误处理,校验不通过则输出'0000-00' SELECT '0000-00' LIST RETURN END CATCH DECLARE @CHAR_MONTH VARCHAR(3) --定义月份的字符串临时变量 drop table t_sclr create table t_sclr( 月份 varchar(7), 装配总数 varchar(20) ) --比较条件:当前年份*12<=目标年和月份则继续 WHILE (DATEPART(YYYY,@DATE_S)*12+DATEPART(MM,@DATE_S)<=DATEPART(YYYY,@DATE_E)*12+DATEPART(MM,@DATE_E)) Begin SET @CHAR_MONTH=CONVERT(VARCHAR(2),DATEPART(MM,@DATE_S)) --转换当前月份的数据类型到字符串 SET @CHAR_MONTH='0'+@CHAR_MONTH --在月份前加“0” SET @CHAR_MONTH=SUBSTRING(@CHAR_MONTH,LEN(@CHAR_MONTH)-2+1,2) --截取最后两位确保月份为1和2的时候其显示为01和02 INSERT INTO t_sclr(月份) VALUES(CONVERT(VARCHAR(4),DATEPART(YYYY,@DATE_S))+'-'+@CHAR_MONTH) SET @DATE_S=DATEADD(MM,1,@DATE_S) --当前月份+1 END SELECT 月份 FROM t_sclr ORDER BY 月份 ASC --按照先后顺序返回需要的结果列表 --2.装配总数 insert into t_sclr(装配总数,月份) select cast(YEAR(a.EXTEND50) as nvarchar(4)) + '-' + cast(MONTH(a.EXTEND50) as nvarchar(2)) as 时间, SUM(isnull(b.OUT_NUM,0)) as 发货数量 from t_contract_order a left join T_CONTRACT_ORDER_DETAIL b on a.sub_account_id=b.sub_account_id where a.EXTEND50>=@KSRQ and a.EXTEND50<=@JSRQ and a.EXTEND1='博莱特工程' group by cast(YEAR(a.EXTEND50) as varchar(4)) + '-' + cast(MONTH(a.EXTEND50) END ``` 这是我的执行结果 消息 156,级别 15,状态 1,过程 bb_sx_sclr,第 53 行 关键字 'END' 附近有语法错误。

尝试写了一个 JDBC 操作 SQLServer 的工具类,但是好像有问题,求大神帮忙指正

java新人,尝试写了一个 JDBC 操作 SQLServer 的工具类,但是好像有问题,调用 insert 指令没问题,而 select 指令出现如下报错: com.microsoft.sqlserver.jdbc.SQLServerException: ')' 附近有语法错误。 at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515) at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:792) at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:689) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(SQLServerStatement.java:616) at com.javaee.servletxm.comm.MSSQLJDBC.select(MSSQLJDBC.java:160) at com.javaee.servletxm.comm.MSSQLJDBC.select(MSSQLJDBC.java:195) at com.javaee.servletxm.comm.MSSQLJDBC.selectFirstValue(MSSQLJDBC.java:172) at com.javaee.servletxm.comm.MSSQLJDBC.getPageNumber(MSSQLJDBC.java:221) at com.javaee.servletxm.comm.MSSQLJDBC.selectByFY(MSSQLJDBC.java:259) at com.javaee.servletxm.kqgl.KqManager.getAllKqxx(KqManager.java:38) at com.javaee.servletxm.kqgl.Kqwh.doGet(Kqwh.java:47) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:723) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:617) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1760) at java.lang.Thread.run(Thread.java:724) 这是具体的代码,求大神帮忙指正 package com.javaee.servletxm.comm; /** * jdbc下 SQL Server 2005 数据库的封装类 */ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.Date; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.List; import java.util.Properties; public class MSSQLJDBC { // 配置文件名称 private String iniFileName = MSSQLJDBC.class.getClassLoader().getResource("/com/javaee/servletxm/comm").getPath()+ "mssql.properties"; // 连接数据库 private String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; private String url = "jdbc:sqlserver://localhost;DatabaseName=jdms"; private String user = "sa"; private String password = ""; // 定义连接属性 private Connection connect = null; // 与连接有关三个通道 private Statement stmt = null; private PreparedStatement pstmt = null; private CallableStatement cstmt = null; public static final String stmtType = "stmt"; public static final String pstmtType = "pstmt"; public static final String cstmtType = "cstmt"; // 定义参数类型的静态常量值 public static final String varCharType = "varchar"; public static final String intType = "int"; public static final String doubleType = "decimal"; public static final String dateType = "datetime"; public static final String timeType = "timestamp"; // 定义全局的结果集 private ResultSet rs = null; // 在构造方法中对属性进行初始化赋值操作 public MSSQLJDBC() { // 读取配置文件 readIni(); // 初始化连接 initConnect(); } // 可配置文件 .properties // 读取配置文件 private void readIni() { File file = new File(iniFileName); if (!file.exists()) { // 创建一个文件 try { file.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } // 判断文件是否有值 if (file.length() == 0) {// 说明是一个空文件 // 初始化值 try { Properties p = new Properties(); p.put("driver", driver); p.put("url", url); p.put("user", user); p.put("password", password); FileOutputStream fos = new FileOutputStream(file); p.store(fos, "配置文件信息"); fos.close(); } catch (IOException e) { e.printStackTrace(); } } else {// 如果有值 // 将信息读取出来 try { FileInputStream fis = new FileInputStream(file); Properties p = new Properties(); p.load(fis); this.driver = p.getProperty("driver"); this.url = p.getProperty("url"); this.user = p.getProperty("user"); this.password = p.getProperty("password"); fis.close(); } catch (IOException e) { e.printStackTrace(); } } } // 建立连接 private void initConnect() { try { Class.forName(driver); this.connect = DriverManager.getConnection(url, user, password); this.connect.setAutoCommit(false);// 设置手动提交事务 this.stmt = connect.createStatement(); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } } /*/ 从tomcat缓冲池获取连接 private void initConnectFromDataSource() { try { InitialContext ic = new InitialContext(); DataSource ds = (DataSource) ic.lookup("java:comp/env/jdbc/oracleds"); this.connect = ds.getConnection(); this.connect.setAutoCommit(false); this.stmt = connect.createStatement(); } catch (NamingException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } }*/ // 需要调用者控制事务的两个方法 // 提交方法 private void commit() { try { this.connect.commit(); } catch (SQLException e) { e.printStackTrace(); } } // 回滚事务 private void rollBack() { try { this.connect.rollback(); } catch (SQLException e) { e.printStackTrace(); } } // 定义一组与操作有关的方法 // 使用普通通道执行的select public ResultSet select(String sql) { ResultSet prs = null; if (stmt != null) { try { prs = stmt.executeQuery(sql); } catch (SQLException e) { e.printStackTrace(); } } return prs; } // 根据传入的sql直接获取单一值 // 使用此方法的时候sql语句返回的单一的值 public String selectFirstValue(String sql, String type, List<String> csList) { String rstr = ""; rs = select(sql, type, csList);// 确定此结果集只有一条记录 if (rs != null) {// 说明结果集有值,且只有一条记录 try { ResultSetMetaData rsmd = rs.getMetaData(); if (rs.next()) { // 移动到第一条记录 String p_type = rsmd.getColumnTypeName(1); rstr = getResultSetValue(rs, 1, p_type); } } catch (SQLException e) { e.printStackTrace(); } } return rstr; } // 使用普通通道执行的select /** * sql 参数 type 使用通道的类型 stmt pstmt cstmt List<String> csList 预编通道执行的参数队列 * String 最少必须满足如下条件的字符串 数据类型 ,数据值 数据类型定义说明 字符串 数字(整数、小数) 日期(DATE、TIMESTAMP) */ public ResultSet select(String sql, String type, List<String> csList) { ResultSet prs = null; if (type.equals(stmtType)) {// 说明使用普通通道来执行 prs = select(sql); } else if (type.equals(pstmtType)) {// 说明使用预编译通道来执行 if (connect != null) { try { pstmt = connect.prepareStatement(sql); // 验证传入的参数和sql中的参数个数一致 setPrepareStatement(pstmt, csList);// 将参数设置进当前的预编译通道 prs = pstmt.executeQuery(); } catch (Exception e) { e.printStackTrace(); } } } return prs; } // 获取 总页数 public int getPageNumber(String sql, String type, List<String> csList, int pageSize) { // 处理总页数 int pageNumber = 0; // 第一步获取sql总记录数 String psql = "select count(*) from (" + sql + ")"; String result = selectFirstValue(psql, type, csList); int rows = 0; if (result != null && result.trim() != "") { rows = Integer.valueOf(result); } if (rows % pageSize == 0) { pageNumber = rows / pageSize; } else { pageNumber = rows / pageSize + 1; } return pageNumber; } /** * 自动添加分页查询方法 * * @param sql * 要执行的sql * @param type * 执行方式 * @param csList * 参数列表 * @param curPage * 当前页数 * @param pageSize * 每页记录数 默认为10 * @return */ public ResultSet selectByFY(String sql, String type, List<String> csList, int curPage, int pageSize) { ResultSet prs = null; // 处理 每页记录数 if (pageSize <= 0) { pageSize = 10;// 默认页面10条记录 } int pageNumber = getPageNumber(sql, type, csList, pageSize); // 处理当前页数 if (curPage < 0) { curPage = 1;// 默认第一页 } if (curPage > pageNumber) { curPage = pageNumber; } String psql = "select tmpaa.* from (select tmpa.*,(select (ROW_NUMBER() over (order by id))) as rn from (" + sql + ") tmpa where (select (ROW_NUMBER() over (order by id))) <= " + (curPage * pageSize) + ") tmpaa where tmpaa.rn >= " + ((curPage - 1) * pageSize + 1); prs = select(psql, type, csList); return prs; } // 将预编通道执行的参数队列按照指定规则设置进通道中 private void setPrepareStatement(PreparedStatement p, List<String> csList) throws Exception { if (csList != null && csList.size() > 0) { for (int i = 0; i < csList.size(); i++) { // 此处的str是数据类型 ,数据值 // 解析出数据类型和数据值 String[] s = csList.get(i).split(","); String sType = s[0]; String sData = s[1]; if (varCharType.equals(sType)) { p.setString(i + 1, sData); } else if (intType.equals(sType)) { p.setInt(i + 1, Integer.valueOf(sData)); } else if(doubleType.equals(sType)){ p.setDouble(i+1, Double.valueOf(sData)); } else if (dateType.equals(sType)) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); java.util.Date d = sdf.parse(sData); p.setDate(i + 1, new Date(d.getTime())); } else if (timeType.equals(sType)) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); java.util.Date d = sdf.parse(sData); p.setTimestamp(i + 1, new Timestamp(d.getTime())); } } } } // 定义一个执行insert update delete的方法 public int iudSql(String sql) { int ri = -1; if (stmt != null) { try { ri = stmt.executeUpdate(sql); commit(); } catch (SQLException e) { e.printStackTrace(); rollBack(); } } return ri; } public int iudSql(String sql, String type, List<String> csList) { int ri = -1; if (stmtType.equals(type)) { ri = iudSql(sql); } else if (pstmtType.equals(type)) { if (connect != null) { try { pstmt = connect.prepareStatement(sql); setPrepareStatement(pstmt, csList); ri = pstmt.executeUpdate(); commit(); } catch (Exception e) { e.printStackTrace(); rollBack(); } } } return ri; } /** * 编写一个通用的遍历ResultSet结果集的方法 */ public void iteratorResultSet(ResultSet rs) { try { if (rs != null) {// 说明有值 // ResultSetMetaData 此对象里封装了与结果集有关所有信息 // 此结果有几列组成,每列的列名,每列的数据类型 ResultSetMetaData rsmd = rs.getMetaData(); // 得到结果集列数 int columnCount = rsmd.getColumnCount(); // 输出此结果集的所有列名 for (int i = 1; i <= columnCount; i++) { System.out.print(rsmd.getColumnName(i) + "\t"); } System.out.println(""); // 遍历输出所有的数据 while (rs.next()) { // 如何在获取rs中的数据? for (int i = 1; i <= columnCount; i++) { String type = rsmd.getColumnTypeName(i); System.out.print(getResultSetValue(rs, i, type) + "\t"); } System.out.println(""); } } } catch (SQLException e) { e.printStackTrace(); } } // 从ResultSet中根据数据类型来得到数据值的方法 // 先处理常用的sqlserver的数据类型的对应 private String getResultSetValue(ResultSet rs, int index, String type) { String rstr = ""; try { if (rs != null && !"".equals(type) && index > 0) { if ("char".equals(type.trim()) || "varchar".equals(type.trim())) { if (rs.getString(index) != null) { rstr = rs.getString(index); } } else if ("int".equals(type.trim())) { rstr = rs.getInt(index) + ""; } else if ("decimal".equals(type.trim())) { rstr = String.valueOf(rs.getDouble(index)); } else if ("date".equals(type.trim())) { Date date = rs.getDate(index); if (date != null) { rstr = new SimpleDateFormat("yyyy年MM月dd日").format(date); } } else if ("timestamp".equals(type.trim()) || "datetime".equals(type.trim())) { Timestamp tt = rs.getTimestamp(index); if (tt != null) { rstr = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒").format(tt); } } } } catch (SQLException e) { e.printStackTrace(); } return rstr; } /* //统一事务管理的批量sql的封装 public boolean iudSql(List<String> sqlList){ int ri = -1; if(stmt!=null){ try { ri = stmt.executeUpdate(sql); commit(); } catch (SQLException e) { e.printStackTrace(); rollBack(); } } return ri; }*/ // 关闭连接 public void close() { try { // 关闭所有的与数据库有关的对象 if (rs != null) { rs.close(); rs = null; } if (stmt != null) { stmt.close(); stmt = null; } if (pstmt != null) { pstmt.close(); pstmt = null; } if (cstmt != null) { cstmt.close(); cstmt = null; } if (connect != null) { connect.close(); connect = null; } } catch (SQLException e) { e.printStackTrace(); } } }

从PHP执行时SQL Server查询不起作用

<div class="post-text" itemprop="text"> <p>I've got a set of <code>triggers</code> in my table in <code>SQL Server</code> and when I execute the queries in <code>SQL Server Management Studio</code> they work fine. But when they're executed from my <code>php</code> files they doesn't take effect. I used <code>SQL Server Profiler</code> and the trigger gets to the last line of execution that is the insert in my log table but then after this I get an <code>Attention</code> error. Here's my trigger for a delete statement:</p> <pre><code>SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- Batch submitted through debugger: SQLQuery25.sql|7|0|C:\Users\ADMINI~1\AppData\Local\Temp\3\~vsB4EE.sql ALTER TRIGGER [dbo].[OperationStructureFields_delete] ON [dbo].[OperationStructureFields] FOR DELETE AS BEGIN DECLARE @id INT, @result varchar(MAX), @user varchar(MAX), @LoopCounter INT = 1, @MAX INT, @Column NVARCHAR(100), @Type NVARCHAR(100), @Value NVARCHAR(100), @ValueXML xml, @Sql NVARCHAR(MAX), @Tmp NVARCHAR(MAX), @LoopCounter2 INT = 1, @MAX2 INT, @Message nvarchar(2048) SELECT @user = system_user SELECT @MAX = MAX(ORDINAL_POSITION) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'OperationStructureFields' SELECT @MAX2 = MAX(ID) FROM deleted SELECT @LoopCounter2 = MIN(ID) FROM deleted Select * into #deleted from deleted WHILE(@LoopCounter2 &lt;= @MAX2) BEGIN SET @LoopCounter = 1 SET @result = '{' WHILE(@LoopCounter &lt;= @MAX) BEGIN SELECT @Column = COLUMN_NAME, @Type = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE ORDINAL_POSITION = @LoopCounter and TABLE_NAME = 'OperationStructureFields' if (@Type = 'xml') BEGIN SET @Sql = 'SELECT @ValueXML = ' + @Column + ' FROM #deleted where ID=' + CONVERT(varchar(200),@LoopCounter2,0) exec sp_executesql @Sql, N'@ValueXML xml out', @ValueXML out SET @Value = CONVERT(VARCHAR(MAX),@ValueXML,0) END ELSE BEGIN SET @Sql = 'SELECT @Value = ' + @Column + ' FROM #deleted where ID=' + CONVERT(varchar(200),@LoopCounter2,0) exec sp_executesql @Sql, N'@Value varchar(MAX) out', @Value out END IF (@Value is not null or @Value != '') and (@Type = 'datetime2' or @Type = 'datetime' or @Type = 'date') BEGIN IF @result = '{' BEGIN SET @result = @result + ' "' + @Column + '":"' + CONVERT(VARCHAR(20),@Value,120) + '"' END ELSE BEGIN SET @result = @result + ', "' + @Column + '":"' + CONVERT(VARCHAR(20),@Value,120) + '"' END END ELSE IF (@Value is not null or @Value != '') BEGIN IF @result = '{' BEGIN SET @result = @result + ' "' + @Column + '":"' + @Value + '"' END ELSE BEGIN SET @result = @result + ', "' + @Column + '":"' + @Value + '"' END END SET @LoopCounter = @LoopCounter + 1 END SET @result = @result + '}' INSERT INTO sys_logs (username,datahora,tabela,[object_id],[action],oldvalue) values (@user,GETDATE(),'OperationStructureFields',@LoopCounter2,'DELETE',@result) delete from #deleted where ID = @LoopCounter2 select @LoopCounter2 = MIN(ID) from #deleted where ID &gt; @LoopCounter2 END END </code></pre> <p>And a print of my SQL Server Profiler:</p> <p><a href="https://i.stack.imgur.com/X9Mjb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X9Mjb.png" alt="Prt Screen do SQL Server Profiler"></a></p> <p>The PHP code is:</p> <pre><code>$res = sqlsrv_query($connection, $_sql, array(), array('Scrollable' =&gt; 'buffered')); </code></pre> <p>and the variable <code>$_sql</code> has the following value:</p> <pre><code>DELETE FROM OperationStructureFields WHERE ID= '66817' </code></pre> <p>And it doesn't return any errors.</p> <p>The PHP version is <code>5.5.16</code>.</p> <p>I executed the <code>SELECT @@OPTIONS</code> inside my php file and got the following options:</p> <pre><code>ANSI_WARNINGS ANSI_PADDING ANSI_NULLS QUOTED_IDENTIFIER ANSI_NULL_DFLT_ON CONCAT_NULL_YIELDS_NULL </code></pre> <p>The only difference to the SQL Server Management Studio is the option <code>ARITHABORT</code> that is <code>ON</code> in the SQL Server Management Studio.</p> <p>Do you have any ideia what may be causing this?</p> <p>UPDATES:</p> <p>I believe it may be something on my PHP settings. In my <code>phpinfo()</code> I've got the following settings for <code>sqlsrv</code>:</p> <p><a href="https://i.stack.imgur.com/n6Y8Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n6Y8Z.png" alt="phpinfo();"></a></p> <p>Also in <code>SQL Server Profiler</code> I've got the following definitions in <code>Audit Login</code>:</p> <pre><code>-- network protocol: LPC set quoted_identifier on set arithabort off set numeric_roundabort off set ansi_warnings on set ansi_padding on set ansi_nulls on set concat_null_yields_null on set cursor_close_on_commit off set implicit_transactions off set language us_english set dateformat mdy set datefirst 7 set transaction isolation level read committed </code></pre> </div>

SQL数据抽取,出现数据类型转换错误,求大神帮忙看一下。

select a.patient_id+'_'+cast(a.item_no as varchar(20))+'_'+cast(a.ledger_sn as varchar(20)) pk_pay,null pk_dcpv,null pvcode,'SDDYRMYY_G' code_group,'SDDYRMYY' code_org , cheque_type code_pay_mode,b.name name_pay_mode,a.charge amount,convert(varchar,a.dcount_date,120) date_pay, 'O' code_pvtype, case when a.charge>=0 then 5 when a.charge<0 then 2 end dt_paytype,a.dcount_id code_psn_pay,psn.name name_psn_pay,mz_dept_no code_dept_pay from mz_deposit_b a left join zd_cheque_type b on a.cheque_type = b.code left join a_employee_mi psn on psn.code = a.dcount_id --WHERE a.dcount_date between ${BEGIN_DATE} and ${END_DATE} where EXISTS ( select patient_id,times from uh_dc_pi_temp t where t.patient_id=a.patient_id ) union all select a.patient_id+'_'+cast(a.item_no as varchar(20))+'_'+cast(a.ledger_sn as varchar(20)) pk_pay,'O' code_pvtype, a.patient_id+'_'+convert(varchar,times) pk_dcpv,a.patient_id+convert(varchar,times) pvcode,'SDDYRMYY_G' code_group,'SDDYRMYY' code_org , cheque_type code_pay_mode,b.name name_pay_mode,a.charge amount,convert(varchar,a.price_date,120) date_pay, 1 dt_paytype,a.price_opera code_psn_pay,psn.name name_psn_pay,mz_dept_no code_dept_pay from gh_deposit_b a left join zd_cheque_type b on a.cheque_type = b.code left join a_employee_mi psn on psn.code = a.price_opera --WHERE price_date between ${BEGIN_DATE} and ${END_DATE} where EXISTS ( select patient_id,times from uh_dc_pi_temp t where t.patient_id=a.patient_id ) union all select a.patient_id+'_'+cast(a.item_no as varchar(20))+'_'+cast(a.ledger_sn as varchar(20)) pk_pay,null pk_dcpv,null pvcode,'SDDYRMYY_G' code_group,'SDDYRMYY' code_org , cheque_type code_pay_mode,b.name name_pay_mode,a.charge amount,convert(varchar,a.dcount_date,120) date_pay, 'O' code_pvtype, case when a.charge>=0 then 5 when a.charge<0 then 2 end dt_paytype,a.dcount_id code_psn_pay,psn.name name_psn_pay,mz_dept_no code_dept_pay from mz_deposit_c a left join zd_cheque_type b on a.cheque_type = b.code left join a_employee_mi psn on psn.code = a.dcount_id --WHERE a.dcount_date between ${BEGIN_DATE} and ${END_DATE} where EXISTS ( select patient_id,times from uh_dc_pi_temp t where t.patient_id=a.patient_id ) union all select a.patient_id+'_'+cast(a.item_no as varchar(20))+'_'+cast(a.ledger_sn as varchar(20)) pk_pay,'O' code_pvtype, a.patient_id+'_'+convert(varchar,times) pk_dcpv,a.patient_id+convert(varchar,times) pvcode,'SDDYRMYY_G' code_group,'SDDYRMYY' code_org , cheque_type code_pay_mode,b.name name_pay_mode,a.charge amount,convert(varchar,a.price_date,120) date_pay, 1 dt_paytype,a.price_opera code_psn_pay,psn.name name_psn_pay,mz_dept_no code_dept_pay from gh_deposit_c a left join zd_cheque_type b on a.cheque_type = b.code left join a_employee_mi psn on psn.code = a.price_opera --WHERE price_date between ${BEGIN_DATE} and ${END_DATE} where EXISTS ( select patient_id,times from uh_dc_pi_temp t where t.patient_id=a.patient_id ) 之前我使用的是convert,会出现‘从数据类型 varchar 转换为 numeric 时出错。错误。改成cast后也是这样。 附:patient_id---char(12),.item_no--smallint,ledger_sn--smallint.

在SQL Server中将datetime列的默认值设置为24h格式

<div class="post-text" itemprop="text"> <p>I want to set the default value of my "Date" column (using getdate() by exemple) to be stored in 24h and not in 12h format.</p> <p>In my SQL Server database I set the default value to be : getdate(). In the database it displays like I want it in 24h format : <code>22/06/2016 10:46:00</code></p> <p>But when I get this value in my php website I get the following value : <code>Jun 22 2016 10:46:00:000AM</code></p> <p>I know that there are ways to convert for what I want like : <code>SELECT CONVERT(VARCHAR(24), GETDATE(), 113)</code></p> <p>But I can't set this query to be the default value of my "Date" column.</p> </div>

如何在NULL字段中插入VARCHAR数据

<div class="post-text" itemprop="text"> <p>I have a database in which there are <code>NOT NULL</code> and <code>NULL</code> fields (the <code>NULL</code>s are of the <code>VARCHAR</code> type).<br> When I try to enter data in the <code>NULL</code> fields via my query, it does not insert them.<br> The data isn't entered all at the same time: </p> <ul> <li>with a form I insert the data in the <code>NOT NULL</code> fields </li> <li>with another form insert the data in the <code>NULL</code> fields.</li> </ul> <p>Why doesn't the query for entering data in the <code>NULL</code> fields sork?   I tried to find an answer to similar questions, but they don't work or are not suitable for my problem:</p> <ol> <li><p><a href="https://stackoverflow.com/questions/20671853/mysql-insert-select-not-null-fields">MySQL Insert Select - NOT NULL fields</a></p></li> <li><p><a href="https://stackoverflow.com/questions/24391566/insert-null-into-date-field-mysql-5-6">Insert NULL into DATE field MySQL 5.6</a></p></li> </ol> <p>FIRST FORM register.php</p> <pre><code>&lt;?php if($_SERVER['REQUEST_METHOD']=='POST'){ // echo $_SERVER["DOCUMENT_ROOT"]; // /home1/demonuts/public_html //including the database connection file include_once("config.php"); $id_akR = $_POST['id_akR']; $numero_telefonoR = $_POST['numero_telefonoR']; if($id_akR == '' || $numero_telefonoR == '' ){ echo json_encode(array( "status" =&gt; "false","message" =&gt; "Parameter missing!") ); }else{ $query= "SELECT * FROM RistoratoreAK WHERE id_akR='$id_akR' OR numero_telefonoR ='$numero_telefonoR' "; $result= mysqli_query($con, $query); $query2 = "SELECT ak_id, numero_telefono FROM AccountKit WHERE ak_id = '$id_akR' OR numero_telefono = '$numero_telefonoR'"; $result2= mysqli_query($con, $query2); if(mysqli_num_rows($result) &gt; 0){ echo json_encode(array( "status" =&gt; "false","message" =&gt; "User already exist in Ristoratore!") ); }else if(mysqli_num_rows($result2) &gt; 0) { echo json_encode(array( "status" =&gt; "false","message" =&gt; "User already exist in Cliente!") ); }else{ $query = "INSERT INTO RistoratoreAK (id_akR, numero_telefonoR) VALUES ('$id_akR','$numero_telefonoR')"; if(mysqli_query($con,$query)){ $query= "SELECT * FROM RistoratoreAK WHERE numero_telefonoR ='$numero_telefonoR'"; $result= mysqli_query($con, $query); $emparray = array(); if(mysqli_num_rows($result) &gt; 0){ while ($row = mysqli_fetch_assoc($result)) { $emparray[] = $row; } } echo json_encode(array( "status" =&gt; "true","message" =&gt; "Successfully registered!" , "data" =&gt; $emparray) ); }else{ echo json_encode(array( "status" =&gt; "false","message" =&gt; "Error occured, please try again!") ); } } mysqli_close($con); } } else{ echo json_encode(array( "status" =&gt; "false","message" =&gt; "Error occured, please try again!") ); } ?&gt; </code></pre> <p><em>SECOND FORM register2.php</em></p> <pre><code>&lt;?php if($_SERVER['REQUEST_METHOD']=='POST'){ include 'config2R.php'; $con = mysqli_connect($HostName,$HostUser,$HostPass,$DatabaseName); $nome = $_POST['nomeR']; $cognome = $_POST['cognomeR']; $data_nascita = $_POST['data_nascitaR']; $sesso = $_POST['sessoR']; $nome_ristorante = $_POST['nome_ristoranteR']; $CheckSQL = "SELECT nome_ristorante FROM RistoratoreAK WHERE nome_ristorante='$nome_ristorante'"; $check = mysqli_fetch_array(mysqli_query($con,$CheckSQL)); if(isset($check)){ echo 'Ristorante già registrato'; } else{ $Sql_Query = "INSERT INTO RistoratoreAK (nomeR,cognomeR,data_nascitaR,sessoR,nome_ristorante) values ('$nome','$cognome','$data_nascita','$sesso','$nome_ristorante')"; if(mysqli_query($con,$Sql_Query)) { echo 'Registration Successfully'; } else { echo 'Something went wrong'; } } } mysqli_close($con); ?&gt; </code></pre> <p>My DB contains a table called "RistoratoreAK", the fields are :</p> <pre><code> id INT PrimaryKey id_ak VARCHAR NOT NULL number VARCHAR NOT NULL nomeR VARCHAR NULL cognomeR VARCHAR NULL sessoR VARCHAR NULL data_nascitaR VARCHAR NULL nome_ristorante VARCHAR NULL </code></pre> <p><em>note: Excuse me if the code isn't secure (I didn't use PDO), this code is just a test to learn how to upload data to the database.</em> </p> </div>

SQL中,添加一个条件后,执行效率瞬间下降,怎么优化

此SQL语句为查询数据库中,当前月,前一月,前两月数据,但是where中加了一个条件后,查找时间从2秒延长至50秒左右,请问造成这种状况的原因是什么?以及有什么优化方法? SELECT TR.RC_NO, TR.FEE_TYPE, TR.FISCAL_PERIOD,--月份 MIN (DATE_START) CUR_DATE_START, MAX (DATE_END) CUR_DATE_END, CONVERT(VARCHAR(30),CAST(SUM(ISNULL(FEE_ACTUAL,0))/ 10000 AS decimal(18,2)),1) AS CUR_FEE_ACTUAL, replace(SUBSTRING ( CAST (DATEADD(m ,- 1, CAST (TR.FISCAL_PERIOD + '01' AS DATE)) AS VARCHAR),1,7),'-','') AS PRE_FISCAL_PERIOD, PRE.PRE_DATE_START, PRE.PRE_DATE_END, PRE.PRE_FEE_ACTUAL, replace(SUBSTRING ( CAST (dateadd(m ,- 2, CAST (TR.FISCAL_PERIOD + '01' AS DATE)) AS VARCHAR),1,7),'-','') AS BEF_FISCAL_PERIOD, BEF.BEF_DATE_START, BEF.BEF_DATE_END, BEF.BEF_FEE_ACTUAL FROM T_AP_PAYMENT_REQUEST TR LEFT JOIN ( SELECT TP.RC_NO,TP.FEE_TYPE, TP.FISCAL_PERIOD, MIN (DATE_START) PRE_DATE_START, MAX (DATE_END) PRE_DATE_END, CONVERT(VARCHAR(30),CAST(SUM(ISNULL(FEE_ACTUAL,0))/ 10000 AS decimal(18,2)),1) AS PRE_FEE_ACTUAL FROM T_AP_PAYMENT_REQUEST TP WHERE IS_DELETE = '0' AND IS_AUTO_PAY = 'D00002' AND ISNULL(IS_FIRST_PAY, '') != 'D00002' AND PR_STATUS != 'L04301' GROUP BY TP.RC_NO, TP.FEE_TYPE, TP.FISCAL_PERIOD ) PRE ON PRE.RC_NO = TR.RC_NO AND PRE.FEE_TYPE=TR.FEE_TYPE LEFT JOIN ( SELECT TA.RC_NO,TA.FEE_TYPE, TA.FISCAL_PERIOD, MIN (DATE_START) BEF_DATE_START, MAX (DATE_END) BEF_DATE_END, CONVERT(VARCHAR(30),CAST(SUM(ISNULL(FEE_ACTUAL,0))/ 10000 AS decimal(18,2)),1) AS BEF_FEE_ACTUAL FROM T_AP_PAYMENT_REQUEST TA WHERE IS_DELETE = '0' AND IS_AUTO_PAY = 'D00002' AND ISNULL(IS_FIRST_PAY, '') != 'D00002' AND PR_STATUS != 'L04301' GROUP BY TA.RC_NO, TA.FEE_TYPE, TA.FISCAL_PERIOD ) BEF ON BEF.RC_NO = TR.RC_NO AND BEF.FEE_TYPE=TR.FEE_TYPE WHERE TR.FISCAL_PERIOD='201701' --此语句为添加的条件 AND PRE.FISCAL_PERIOD = replace(SUBSTRING (CAST (dateadd(m ,- 1,CAST (TR.FISCAL_PERIOD + '01' AS DATE)) AS VARCHAR),1,7),'-','') AND BEF.FISCAL_PERIOD = replace(SUBSTRING (CAST (dateadd(m ,- 2,CAST (TR.FISCAL_PERIOD + '01' AS DATE)) AS VARCHAR),1,7),'-','') AND TR.IS_DELETE = '0' AND TR.IS_AUTO_PAY = 'D00002' AND ISNULL(TR.IS_FIRST_PAY, '') != 'D00002' AND TR.PR_STATUS != 'L04301' GROUP BY TR.RC_NO, TR.FEE_TYPE, TR.FISCAL_PERIOD, PRE.PRE_DATE_START, PRE.PRE_DATE_END, PRE.PRE_FEE_ACTUAL, BEF.BEF_DATE_START, BEF.BEF_DATE_END, BEF.BEF_FEE_ACTUAL ORDER BY TR.RC_NO, TR.FEE_TYPE, TR.FISCAL_PERIOD 代码需要注释的,直接问就可以了

sqlserver数据库怎样优化代码

select c.participant_name, c.login_id, @year as y, datepart(MONTH,receive_date) as m, b.phase_name as lc, m.manu_number as gh, max(datediff(day, m.submit_date, a.submit_date)) as t from manuflow a left join review_phase b on a.phase_id=b.phase_id left join participant c on a.submitter_id=c.participant_id,manuscript m where (@editor='' or c.participant_name=@editor) and receive_date>=(@year+'-1-1') and receive_date<( cast(cast(@year as int)+1 as varchar(4))+'-1-1' ) and not c.login_id is null and not c.participant_name is null and a.submit_date >= (@year+'-1-1') and a.submit_date<( cast(cast(@year as int)+1 as varchar(4))+'-1-1' ) and m.submit_date >= (@year+'-1-1') and m.submit_date<( cast(cast(@year as int)+1 as varchar(4))+'-1-1' ) and m.submit_date <= a.submit_date and b.phase_name = 'szs' and m.manu_number in(select manu_number from #GH) group by b.phase_name,m.manu_number,c.participant_name,c.login_id,datepart(MONTH,receive_date) order by c.participant_name,c.login_id,datepart(MONTH,receive_date),b.phase_name,m.manu_number,max(datediff(day, m.submit_date, a.submit_date)) **怎么能让它运行的更快一些**

从字符串转换日期/或时间时,转换失败

用的VS2012版本写的程序,然后数据库是SQL2008版本。程序运行的时候这个部分一直出现这个问题,只要是涉及时间的。看了好久不知道哪里出错了。 ![图片说明](https://img-ask.csdn.net/upload/202005/21/1590038889_692242.png)![图片说明](https://img-ask.csdn.net/upload/202005/21/1590038902_109761.png) 数据库的话是这样设置的: ![图片说明](https://img-ask.csdn.net/upload/202005/21/1590039155_604520.png) 代码: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace HotelManage { public partial class FormPurchase : Form { public FormPurchase() { InitializeComponent(); } OperatorDBClass operat = new OperatorDBClass(); private void InitDataGridViewHead() { this.dataGridViewPurchase.Columns[0].HeaderText = "商品编号"; this.dataGridViewPurchase.Columns[0].Width = 100; this.dataGridViewPurchase.Columns[1].HeaderText = "供货商编号"; this.dataGridViewPurchase.Columns[1].Width = 180; this.dataGridViewPurchase.Columns[2].HeaderText = "商品名称"; this.dataGridViewPurchase.Columns[2].Width = 140; this.dataGridViewPurchase.Columns[3].HeaderText = "商品规格"; this.dataGridViewPurchase.Columns[3].Width = 100; this.dataGridViewPurchase.Columns[4].HeaderText = "进价"; this.dataGridViewPurchase.Columns[4].Width = 80; this.dataGridViewPurchase.Columns[5].HeaderText = "售价"; this.dataGridViewPurchase.Columns[5].Width = 100; this.dataGridViewPurchase.Columns[6].HeaderText = "数量"; this.dataGridViewPurchase.Columns[6].Width = 80; this.dataGridViewPurchase.Columns[7].HeaderText = "生产日期"; this.dataGridViewPurchase.Columns[7].Width = 160; this.dataGridViewPurchase.Columns[8].HeaderText = "保质期"; this.dataGridViewPurchase.Columns[8].Width = 160; } /// <summary> /// 录入商品信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonOk_Click(object sender, EventArgs e) { try { if (textBoxId.Text != "" && textBoxName.Text != "" && textBoxBid.Text != "" && textBoxSellPrice.Text != "") { if (operat.FindIdExist("Products", "products_id", textBoxId.Text) == true) { MessageBox.Show("该商品编号已经存在,请重新添加!", "提示"); return; } else { string productor_id = this.textBoxId.Text; string vendorsname = ""; //供货商名称 string productor_name = this.textBoxName.Text; string productor_spec = this.comboBoxSpec.Text; string productor_bid = this.textBoxBid.Text; string productor_sell_price = this.textBoxSellPrice.Text; string productor_date = this.dateTimePicker1.Text; string productor_quality_date = this.comboBoxQuality.Text; vendorsname = operat.FindVendorsId("Vendors", comboBoxVen.Text); string InsertSql = "insert into Products values(" + productor_id + ",'"+ vendorsname+"','" + productor_name + "','"; InsertSql += productor_spec + "','" + productor_bid + "','" + productor_sell_price + "','"+textBoxProNum.Text+"','" + productor_date + "','"; InsertSql += productor_quality_date + "')"; if (operat.OperateData(InsertSql) > 0) { operat.StoreManage(productor_id, productor_sell_price,textBoxProNum.Text); MessageBox.Show("录入商品信息成功!", "提示"); operat.DataBind(this.dataGridViewPurchase, "select *from Products", "Products"); return; } } } else { MessageBox.Show("请填满所有字段", "提示"); return; } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { //关闭数据库 operat.CloseDatabaseCnn(); } } private void FormPurchase_Load(object sender, EventArgs e) { operat.BindDropdownlist("Vendors", this.comboBoxVen, 1); operat.DataBind(this.dataGridViewPurchase, "select *from Products", "Products"); InitDataGridViewHead(); //绑定商品单位到下拉框 operat.BindDropdownlist("Products_Unit", this.comboBoxSpec, 1); } } }

SQL插入日期始终为NULL

<div class="post-text" itemprop="text"> <p>I'm trying to use an upload page to insert into my database with the following code:</p> <pre><code>if($file!=="") { echo "&lt;br/&gt;".$file; $handle = fopen($file, "r"); $row = 0; $delete_records = mysql_query("DELETE FROM affiliationagreements"); $delete_records = mysql_query("DELETE FROM college"); $delete_records = mysql_query("DELETE FROM program"); $delete_records = mysql_query("DELETE FROM facility"); $delete_records = mysql_query("DELETE FROM submitor"); $delete_records = mysql_query("DELETE FROM location"); //will loop each record in the CSV file while(($fileop = fgetcsv($handle,1000,",")) !== false ) { //columns names of the CSV file are not needed if($row==0) { $row++; } else { //accept apostrophes in the strings $fileop = array_map("mysql_real_escape_string",$fileop); $sql = mysql_query("INSERT INTO affiliationagreements(id, AANumber, Facility, Submitor, Program, Location, College, SubmissionDate, Action, EffectiveDate, Status, ExpirationDate) VALUES('', '$fileop[0]', '$fileop[1]', '$fileop[2]', '$fileop[3]', '$fileop[4]', '$fileop[5]', '$fileop[11]', '$fileop[23]', '$fileop[24]', '$fileop[25]', '$fileop[26]') ")or die(mysql_error()); </code></pre> <p>To just give a sample, and when I upload my CSV file to add the values, I print them out in the console and see that the values are being read correctly and they are. But, once my php script ends and I return to the main page, my dates are all null. None of them are the values what are reflected in the csv file. Here is the schema for my database:</p> <pre><code>CREATE TABLE `affiliationagreements` ( `id` int(11) NOT NULL AUTO_INCREMENT, `AANumber` varchar(20) DEFAULT NULL, `Facility` varchar(150) DEFAULT NULL, `Submitor` varchar(50) DEFAULT NULL, `Program` varchar(60) DEFAULT NULL, `Location` varchar(50) DEFAULT NULL, `College` varchar(50) DEFAULT NULL, `SubmissionDate` date DEFAULT NULL, `Action` varchar(50) DEFAULT NULL, `EffectiveDate` date DEFAULT NULL, `Status` varchar(50) DEFAULT NULL, `ExpirationDate` date DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; </code></pre> <p>If I change SubmissionDate, EffectiveDate, and ExpirationDate to a varchar, they insert correctly but I can't use varchar because I am comparing date values. And Advice?</p> <p>***Update. In the CSV file, the format is MM/DD/YYYY. I didn't think this would be a problem. Would it be better to change this? And I'm deleting records because my boss wanted the DB cleared before a file was reuploaded since the uploaded file was an update of the previously uploaded one. ****</p> </div>

查询SQL数据只显示第一条不能全部显示

<!--#include file="conn.asp"--> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>现住客人房费一表</title> <base target="main"> </head> <body> <% DataServer = "lx" DataUser = "sa" DataBaseName = "hy2006qt" DataBasePsw = "" Set conn = Server.CreateObject("ADODB.Connection") ConnStr="driver={SQL Server};server="&dataserver&";UID="&datauser&";PWD="&databasepsw&";Database="&databasename conn.open ConnStr Set rs=Server.CreateObject("ADODB.RecordSet") dim rs,sql,scount //sql="select * from Trans WHERE (YEAR([Date]) = YEAR({ fn NOW() })) AND (MONTH([Date]) = MONTH({ fn NOW() })) AND (DAY([Date]) = DAY({ fn NOW() }))" sql="select * from Trans WHERE (Room > 301) AND (Room < 711)" //sql="select * from Trans WHERE (TransCode <= 2)" //sql="select * from Trans WHERE (Amount < 80)" //sql="select * from Trans WHERE (Amount > 500)" //sql="SELECT m.* FROM Trans m INNER JOIN (SELECT date, room, amount, transcode, COUNT(*) cnt FROM trans WHERE date = CONVERT(varchar(100), GETDATE(), 23) AND transcode <= 2 GROUP BY date, room, amount, transcode) t ON m.Room = t.room AND m.Amount = t.amount AND m.TransCode = t.transcode AND m.[Date] = t.[date] WHERE (t.cnt > 1)" //BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。/hycom/hyquery/foom.asp,行 0 //sql="select distinct(trans),date,room,transcode,amount feom indent where room=0 order by id desc" rs.Open sql,conn,1,1 scount = rs.recordcount set aa=conn.execute(sql) set bb=conn.execute(sql) set cc=conn.execute(sql) set dd=conn.execute(sql) set ee=conn.execute(sql) set ff=conn.execute(sql) response.write "<table border="&chr(34)&"1"&chr(34)&" width="&chr(34)&"980"&chr(34)&" heifgt="&chr(34)&"46"&chr(34)&" id="&chr(34)&"table1"&chr(34)&">" response.write "<tr>" response.write "<td width="&chr(34)&"150"&chr(34)&" height="&chr(34)&"14"&chr(34)&" align="&chr(34)&"center"&chr(34)&">日期</td>" response.write "<td width="&chr(34)&"150"&chr(34)&" height="&chr(34)&"14"&chr(34)&" align="&chr(34)&"center"&chr(34)&">房号</td>" response.write "<td width="&chr(34)&"150"&chr(34)&" height="&chr(34)&"14"&chr(34)&" align="&chr(34)&"center"&chr(34)&">账项</td>" response.write "<td width="&chr(34)&"150"&chr(34)&" height="&chr(34)&"14"&chr(34)&" align="&chr(34)&"center"&chr(34)&">房费小于80</td>" response.write "<td width="&chr(34)&"150"&chr(34)&" height="&chr(34)&"14"&chr(34)&" align="&chr(34)&"center"&chr(34)&">房费大于500</td>" response.write "</tr>" %> //<%do while not rs.eof%> <% response.write "<tr>" response.write "<td height="&chr(34)&"14"&chr(34)&" width="&chr(34)&"150"&chr(34)&">"&aa("date")&"</td>" response.write "<td height="&chr(34)&"14"&chr(34)&" width="&chr(34)&"150"&chr(34)&">"&bb("room")&"</td>" response.write "<td height="&chr(34)&"14"&chr(34)&" width="&chr(34)&"150"&chr(34)&">"&cc("transcode")&"</td>" response.write "<td height="&chr(34)&"14"&chr(34)&" width="&chr(34)&"150"&chr(34)&">"&dd("amount")&"</td>" response.write "<td height="&chr(34)&"14"&chr(34)&" width="&chr(34)&"150"&chr(34)&">"&scount&"</td>" response.write "<tr/>" rs.movenext loop rs.close set rs=nothing %> <% response.write "</table>" %> </body> </html> 注:sql="select * from Trans WHERE (Room > 301) AND (Room < 711)" 这个查询的结果只显示第一条,怎么修改才能全部显示。

T-SQL修改字段属性,求指教,急!!

表已经建好,存在很多外键关系,删除不方便,由于逻辑问题,必须将 表 中的 PI_ClassInfo CI_StartTime_Date DATETIME NOT NULL, CI_EndTime_Date DATETIME NOT NULL 改为 CI_StartTime_VarC VARCHAR(16) NOT NULL, CI_EndTime__VarC VARCHAR(16) NOT NULL 求语句

Mysql建表显示错误,Error : You have an error in your SQL syntax;(急!!!)

create TABLE ProductIns (product_id char(4) NOT FULL, product_name VARCHAR(100) NOT FULL, product_type varchar(32) NOT FULL, sale_price INTEGER DEFAULT 0, purchase_price INTEGER , regist_date INTEGER , PRIMARY KEY (product_id)); 在mysql创建上面这么一个表格显示错误: Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FULL, product_name VARCHAR(100) NOT FULL, product_type varchar(32) NOT ' at line 2 请问问题是出在哪里了

错误代码: 1064 You have an error in your SQL syntax;

求高手指点 语法哪里有问题啊 DELIMITER $$ CREATE /*[DEFINER = { user | CURRENT_USER }]*/ PROCEDURE `x_similarity`.`CovarianceEngine`() /*LANGUAGE SQL | [NOT] DETERMINISTIC | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA } | SQL SECURITY { DEFINER | INVOKER } | COMMENT 'string'*/ BEGIN /* 定义变量一 */ DECLARE done, done2 INT DEFAULT 0; DECLARE stockNo_a VARCHAR(6); DECLARE coefficient DOUBLE(16,14); /* 定义光标 */ DECLARE _Cur CURSOR FOR SELECT DISTINCT stock_no FROM history_day; DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;#错误定义,标记循环结束 /* 打开光标 */ OPEN _Cur; /* 循环执行 */ REPEAT FETCH _Cur INTO stockNo_a; IF NOT done THEN BEGIN /* 定义变量一 */ DECLARE stockNo_b VARCHAR(6); /* 定义光标 */ DECLARE _CurInner CURSOR FOR SELECT DISTINCT stock_no FROM history_day; OPEN _CurInner; REPEAT FETCH _CurInner INTO stockNo_b; IF NOT done2 THEN SELECT ( AVG(a. CLOSE * b. CLOSE) - AVG(a. CLOSE) * AVG(b. CLOSE) ) / SQRT( ( AVG(a. CLOSE * a. CLOSE) - AVG(a. CLOSE) * AVG(a. CLOSE) ) * ( AVG(b. CLOSE * b. CLOSE) - AVG(b. CLOSE) * AVG(b. CLOSE) ) ) INTO coefficient FROM history_day a, history_day b WHERE a.date = b.date AND a.date >= '2015-08-05' AND a.date <= '2015-08-11' AND a.stock_no = stockNo_a AND b.stock_no = stockNo_b; IF coefficient > 0.5 OR coefficient < -0.5 THEN INSERT INTO correlationanalysis (stock_no_f, stock_no_r, coefficient) VALUES(stockNo_a, stockNo_b, coefficient); COMMIT; END IF; END IF; UNTIL done2 END REPEAT; CLOSE _CurInner; SET done2 = 0; END END IF; UNTIL done END REPEAT; CLOSE _Cur; END$$ DELIMITER ; 错误代码: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END IF; UNTIL done END REPEAT; CLOSE _Cur; END' at line 65

PDO ODBC为列值返回null,但odbc_conect不返回

<div class="post-text" itemprop="text"> <p>For some weird reason, my PDO keeps returning NULL when it should return a string/integer. I've tried to use the <code>odbc_conect</code> and it works fine.</p> <p>Context:</p> <ul> <li>CentOS 7</li> <li>PHP 7.1.13 </li> <li>unixODBC 2.3.1 (x86_64 . 11.el7)</li> <li>ODCB Driver: SAP HANA ODBC v2.2.36.1512099132 64 bits</li> </ul> <p>When it's happening? Until now, I detected few:</p> <ul> <li>Function returns: <code>SELECT id,GEO.ST_Asgeojson() FROM DEV.GEOMETRIES</code></li> <li>Using CAST: <code>SELECT id, CAST(GEO.ST_AsText() AS VARCHAR) FROM DEV.GEOMETRIES</code> or <code>SELECT CAST(1 AS INTEGER) AS "int" FROM DUMMY</code> </li> <li>Any blob column : <code>SELECT id,GEO FROM DEV.GEOMETRIES</code></li> <li>Date Types: <code>SELECT insertdate FROM DEV.GEOMETRIES</code></li> </ul> <p>I also tried to use <a href="http://php.net/manual/en/pdostatement.bindcolumn.php" rel="nofollow noreferrer">PDOStatement::bindColumn</a> to force data types but was unsuccessful</p> <p>Where the code :</p> <pre><code>&lt;?php try{ ini_set('memory_limit','256M'); //odbc_fetch_array is hungry // $sql = 'SELECT NOW() AS "now" FROM DUMMY'; $sql = "SELECT id,GEO.ST_Asgeojson(),GEO.ST_AsText(),insertdate FROM DEV.geometries limit 1"; //$sql = "SELECT * FROM DEV.geometries limit 1"; // $sql = "SELECT CAST(GEO.ST_AsText() AS VARCHAR) from geometries"; // $sql = "SELECT CAST(10 AS VARCHAR) from DUMMY"; // $sql = "SELECT CAST(10 AS INTEGER) from DUMMY"; echo "SQL: ",$sql,PHP_EOL; $DSN = "DRIVER=HANADB;UID=DEV;PWD=DEV@pwd;SERVERNODE=192.168.1.163:39013;DATABASENAME=SYSTEMDB"; $options = [ \PDO::ATTR_ERRMODE =&gt; \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_CASE =&gt;\PDO::CASE_LOWER, //Compatibility with mysql case \PDO::ATTR_DEFAULT_FETCH_MODE =&gt; \PDO::FETCH_ASSOC, \PDO::ATTR_EMULATE_PREPARES, true //With or without ]; echo "############# Using PDO:ODBC:",PHP_EOL; $DB = new \PDO("odbc:".$DSN,'DEV','DEV@pwd',$options); echo "Driver: ",$DB-&gt;getAttribute(\PDO::ATTR_CLIENT_VERSION),PHP_EOL; echo "Using Prepared Statement:",PHP_EOL; $stmt = $DB-&gt;prepare($sql); // bindColumn Also doesn't work //$stmt-&gt;bindColumn('id', $id, \PDO::PARAM_INT); //$stmt-&gt;bindColumn('geojson', $geometry, \PDO::PARAM_STR); $stmt-&gt;execute(); /*while ($row = $stmt-&gt;fetch(\PDO::FETCH_BOUND)) { var_dump($row); var_dump($id, $geometry); }*/ //var_dump($ret,$stmt); var_export($stmt-&gt;fetchAll()); $stmt-&gt;closeCursor(); echo PHP_EOL,"Using Query:",PHP_EOL; $qR = $DB-&gt;query($sql); foreach($qR as $row){ var_export($row); } echo PHP_EOL,PHP_EOL,"############# Using odbc_*( ) Functions",PHP_EOL; $conn = odbc_connect($DSN,'DEV','DEV@pwd'); $rs = odbc_exec($conn,$sql); while($row = odbc_fetch_array($rs)){ var_export($row); } }catch(\Exception $e){ echo $e-&gt;getMessage(),PHP_EOL,$e-&gt;getTraceAsString(); } </code></pre> <p>Output:</p> <pre><code>############# Using PDO:ODBC: Using Prepared Statement: array ( 0 =&gt; array ( 'id' =&gt; '363491', 'geojson' =&gt; NULL, 'geotext' =&gt; NULL, '__dateinsert' =&gt; NULL, 'info' =&gt; NULL, ), ) Using Query: array ( 'id' =&gt; '363491', 'geojson' =&gt; NULL, 'geotext' =&gt; NULL, 'insertdate' =&gt; NULL, 'info' =&gt; NULL, ) ############# Using odbc_*( ) Functions array ( 'id' =&gt; '363491', 'geojson' =&gt; '{"type": "Point", "coordinates": [16.352878, 48.225628]}', 'geotext' =&gt; 'POINT (16.352878 48.225628)', 'insertdate ' =&gt; '2018-02-06 15:08:19.414000000', 'info' =&gt; NULL, ) </code></pre> <p>I'm not sure if it's a Drive problem because it works with <code>odbc_*</code> functions, maybe it's a PDO BUG. </p> </div>

SQL-JOIN错误=>多个表中的相同列名

<div class="post-text" itemprop="text"> <p>I have some trouble trying to join a couple of tables for a time-booking system.</p> <p>The database look like this:</p> <h2><strong>Database tables:</strong></h2> <p>tbl_events</p> <pre><code>- int_eventID (INT) - int_serviceID (INT) - date_eventDueDate (DATETIME) - date_eventCreationDate (DATETIME) - int_userID (INT) - int_customerID (INT) - int_eventOnlineBooked (INT) </code></pre> <p>tbl_customers</p> <pre><code>- int_customerID (INT) &gt;&gt;&gt; - int_userID (INT) &lt;= this one gives me headache &lt;&lt; - str_customerFirstName (VARCHAR) - str_customerLastName (VARCHAR) - str_customerEmail (VARCHAR) - str_customerPassword (VARCHAR) - str_customerCellPhone (VARCHAR) - str_customerHomePhone (VARCHAR) - str_customerAddress (VARCHAR) </code></pre> <p>tbl_services</p> <pre><code>int_serviceID (INT) str_serviceName (VARCHAR) str_serviceDescription (VARCHAR) int_servicePrice (INT) int_serviceTimescale (TIME) </code></pre> <p>tbl_users</p> <pre><code>int_userID (INT) str_userFirstName (VARCHAR) str_userLastName (VARCHAR) str_userEmail (VARCHAR) str_userPassword (VARCHAR) str_userCellPhone (VARCHAR) </code></pre> <hr> <p>I've got everything to work as expected by the SQL-query (see below). It gives me all events for a specific "user" during a specific week.</p> <h2><strong>SQL query:</strong></h2> <pre><code>SELECT int_customerID as customerID, int_serviceID as serviceID, int_eventID as eventID, date_eventDueDate as eventDueDate, date_eventCreationDate as eventCreationDate, int_eventOnlineBooked as eventOnlineBooked, str_serviceName as serviceName, int_serviceTimescale as serviceTimescale, str_customerFirstName as customerFirstName, str_customerLastName as customerLastName, str_customerCellPhone as customerCellPhone, str_customerHomePhone as customerHomePhone FROM tbl_events JOIN tbl_services USING (int_serviceID) JOIN tbl_customers USING (int_customerID) WHERE int_userID = 1 AND YEARWEEK(date_eventDueDate,1) = 201219 </code></pre> <hr> <p>The problem is, I didn't had a column in the tbl_customers table that specified which user that customer belongs to. When I added "int_userID" to tbl_customers the SQL-stopped working and gave me the error message:</p> <pre><code>&lt;b&gt;Warning&lt;/b&gt;: mysql_num_rows() expects parameter 1 to be resource, boolean given in &lt;b&gt;/Library/WebServer/Documents/calendar/api/calender_getWeekGetEvents.php&lt;/b&gt; on line &lt;b&gt;46&lt;/b&gt;&lt;br /&gt; </code></pre> <p>Line 46:</p> <pre><code>if(mysql_num_rows($result)) { while($event = mysql_fetch_assoc($result)) { $events[] = $event; } } </code></pre> <p>Any ideas? :)</p> <p>Thanks / L</p> </div>

PHP SQL Server查询运行不在PHP中工作

<div class="post-text" itemprop="text"> <p>I currently have a query that is working in MS SQL Server Management studio, without any problems, when i run the query in php it just doesn't return anything. </p> <p>Here is the query and PHP code </p> <pre><code> Public function GetClockedHours() { $conn = odbc_connect('easydo', '', ''); if (!$conn) { exit("Connection Failed: " . $conn); } var_dump($conn); $sql = " WITH ByDays AS ( SELECT CHINA_VISION_DorEvents.EventTm AS T, CONVERT(VARCHAR(10),CHINA_VISION_DorEvents.EventTm,102) AS Day, FLOOR(CONVERT(FLOAT,CHINA_VISION_DorEvents.EventTm)) DayNumber, ROW_NUMBER() OVER(PARTITION BY FLOOR(CONVERT(FLOAT,CHINA_VISION_DorEvents.EventTm)) ORDER BY CHINA_VISION_DorEvents.EventTm) InDay FROM CHINA_VISION_DorEvents Where CHINA_VISION_DorEvents.DorCtrls_Ref = '16' AND CHINA_VISION_DorEvents.CardCode = '000006f1' AND CONVERT(Date,CHINA_VISION_DorEvents.EventTm) &gt; dateadd(day, -7, getdate()) ) ,Diffs AS ( SELECT E.Day, E.T ET, O.T OT, O.T-E.T Diff, DATEDIFF(S,E.T,O.T) DiffSeconds -- difference in seconds FROM (SELECT BE.T, BE.Day, BE.InDay FROM ByDays BE WHERE BE.InDay % 2 = 1) E -- Even rows INNER JOIN (SELECT BO.T, BO.Day, BO.InDay FROM ByDays BO WHERE BO.InDay % 2 = 0) O -- Odd rows ON E.InDay + 1 = O.InDay -- Join rows (1,2), (3,4) and so on AND E.Day = O.Day -- in the same day ) SELECT Day, SUM(DiffSeconds) Seconds, CONVERT(VARCHAR(8), (DATEADD(S, SUM(DiffSeconds), '1900-01-01T00:00:00')), 108) TotalHHMMSS -- The same, formatted as HH:MM:SS FROM Diffs GROUP BY Day ORDER BY Day desc "; $rs = odbc_exec($conn, $sql); if (!$rs) { exit("Error in SQL"); }else{ echo "Get Connection"; } var_dump($rs); var_dump($sql); $array = array(); $i = 1; var_dump(odbc_fetch_array($rs, $i)); while ($row = odbc_fetch_array($rs, $i)) { foreach ($row AS $key =&gt; $value) { $array[$i][$key] = $row[$key]; } $i++; } var_dump($row); var_dump($array); return $array; } </code></pre> <p>The PHP Part of this code work, even though it's not the best way to connect to the database, however looking at what is returned at each stage there is just nothing being returned.</p> <p>When i cut the query down to just the first select. </p> <pre><code>SELECT CHINA_VISION_DorEvents.EventTm AS T, CONVERT(VARCHAR(10),CHINA_VISION_DorEvents.EventTm,102) AS Day, FLOOR(CONVERT(FLOAT,CHINA_VISION_DorEvents.EventTm)) DayNumber, ROW_NUMBER() OVER(PARTITION BY FLOOR(CONVERT(FLOAT,CHINA_VISION_DorEvents.EventTm)) ORDER BY CHINA_VISION_DorEvents.EventTm) InDay FROM CHINA_VISION_DorEvents Where CHINA_VISION_DorEvents.DorCtrls_Ref = '16' AND CHINA_VISION_DorEvents.CardCode = '000006f1' AND CONVERT(Date,CHINA_VISION_DorEvents.EventTm) &gt; dateadd(day, -7, getdate()) </code></pre> <p>Without the WITH ByDays part the query actually returned what i would expect it to return at that point of the query, so with the "WITH ByDays AS (" section and everything that follows on the query won't work in php why is this and how can i fix this</p> </div>

使用PHP创建数据库表 - SQLSTATE [42000]:语法错误或访问冲突:1064

<div class="post-text" itemprop="text"> <p><strong>SOLVED</strong></p> <p>Hi I'm having trouble creating tables due to this syntax error: </p> <blockquote> <p>SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 11</p> </blockquote> <p>I've checked the other solutions for this error, but i have yet to resolve it. I'm wondering if anyone can spot the problem. My code looks like this:</p> <pre><code>&lt;?php $servername = "localhost"; $username = "root"; $password = ""; $dbname = "myDB"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); // set the PDO error mode to exception $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // sql to create table $sql = "CREATE TABLE users ( id INT(6) UNSIGNED AUTO_INCREMENT, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, email VARCHAR(50), password VARCHAR(256), reg_date TIMESTAMP, is_author INT(6), is_admin INT(6), )"; echo "&lt;/br&gt;"; // use exec() because no results are returned $conn-&gt;exec($sql); echo "Table created successfully"; } catch(PDOException $e) { echo $sql . "&lt;br&gt;" . $e-&gt;getMessage(); } $conn = null; ?&gt; </code></pre> </div>

定量遥感中文版 梁顺林著 范闻捷译

这是梁顺林的定量遥感的中文版,由范闻捷等翻译的,是电子版PDF,解决了大家看英文费时费事的问题,希望大家下载看看,一定会有帮助的

Java 最常见的 200+ 面试题:面试必备

这份面试清单是从我 2015 年做了 TeamLeader 之后开始收集的,一方面是给公司招聘用,另一方面是想用它来挖掘在 Java 技术栈中,还有那些知识点是我不知道的,我想找到这些技术盲点,然后修复它,以此来提高自己的技术水平。虽然我是从 2009 年就开始参加编程工作了,但我依旧觉得自己现在要学的东西很多,并且学习这些知识,让我很有成就感和满足感,那所以何乐而不为呢? 说回面试的事,这份面试...

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

远程工具,免费

远程工具,免费

java jdk 8 帮助文档 中文 文档 chm 谷歌翻译

JDK1.8 API 中文谷歌翻译版 java帮助文档 JDK API java 帮助文档 谷歌翻译 JDK1.8 API 中文 谷歌翻译版 java帮助文档 Java最新帮助文档 本帮助文档是使用谷

csma/ca和csma/cd的matlab仿真源代码带有详细的注释

csma/ca和csma/cd的matlab仿真源代码带有详细的注释,载波侦听,随意设置节点数,带有炫酷的图形展示效果。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

软件测试入门、SQL、性能测试、测试管理工具

软件测试2小时入门,让您快速了解软件测试基本知识,有系统的了解; SQL一小时,让您快速理解和掌握SQL基本语法 jmeter性能测试 ,让您快速了解主流来源性能测试工具jmeter 测试管理工具-禅道,让您快速学会禅道的使用,学会测试项目、用例、缺陷的管理、

pokemmo的资源

pokemmo必须的4个rom 分别为绿宝石 火红 心金 黑白 还有汉化补丁 资源不错哦 记得下载

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

无线通信中的智能天线:IS-95和第3代CDMA应用_.pdf

无线通信中的智能天线:IS-95和第3代CDMA应用_.pdf

设计模式(JAVA语言实现)--20种设计模式附带源码

课程亮点: 课程培训详细的笔记以及实例代码,让学员开始掌握设计模式知识点 课程内容: 工厂模式、桥接模式、组合模式、装饰器模式、外观模式、享元模式、原型模型、代理模式、单例模式、适配器模式 策略模式、模板方法模式、观察者模式、迭代器模式、责任链模式、命令模式、备忘录模式、状态模式、访问者模式 课程特色: 笔记设计模式,用笔记串连所有知识点,让学员从一点一滴积累,学习过程无压力 笔记标题采用关键字标识法,帮助学员更加容易记住知识点 笔记以超链接形式让知识点关联起来,形式知识体系 采用先概念后实例再应用方式,知识点深入浅出 提供授课内容笔记作为课后复习以及工作备查工具 部分图表(电脑PC端查看):

Java8零基础入门视频教程

这门课程基于主流的java8平台,由浅入深的详细讲解了java SE的开发技术,可以使java方向的入门学员,快速扎实的掌握java开发技术!

玩转Linux:常用命令实例指南

人工智能、物联网、大数据时代,Linux正有着一统天下的趋势,几乎每个程序员岗位,都要求掌握Linux。本课程零基础也能轻松入门。 本课程以简洁易懂的语言手把手教你系统掌握日常所需的Linux知识,每个知识点都会配合案例实战让你融汇贯通。课程通俗易懂,简洁流畅,适合0基础以及对Linux掌握不熟练的人学习; 【限时福利】 1)购课后按提示添加小助手,进答疑群,还可获得价值300元的编程大礼包! 2)本月购买此套餐加入老师答疑交流群,可参加老师的免费分享活动,学习最新技术项目经验。 --------------------------------------------------------------- 29元=掌握Linux必修知识+社群答疑+讲师社群分享会+700元编程礼包。 &nbsp;

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

想学好JAVA必须要报两万的培训班吗? Java大神勿入 如果你: 零基础想学JAVA却不知道从何入手 看了一堆书和视频却还是连JAVA的环境都搭建不起来 囊中羞涩面对两万起的JAVA培训班不忍直视 在职没有每天大块的时间专门学习JAVA 那么恭喜你找到组织了,在这里有: 1. 一群志同道合立志学好JAVA的同学一起学习讨论JAVA 2. 灵活机动的学习时间完成特定学习任务+每日编程实战练习 3. 热心助人的助教和讲师及时帮你解决问题,不按时完成作业小心助教老师的家访哦 上一张图看看前辈的感悟: &nbsp; &nbsp; 大家一定迫不及待想知道什么是极简JAVA学习营了吧,下面就来给大家说道说道: 什么是极简JAVA学习营? 1. 针对Java小白或者初级Java学习者; 2. 利用9天时间,每天1个小时时间; 3.通过 每日作业 / 组队PK / 助教答疑 / 实战编程 / 项目答辩 / 社群讨论 / 趣味知识抢答等方式让学员爱上学习编程 , 最终实现能独立开发一个基于控制台的‘库存管理系统’ 的学习模式 极简JAVA学习营是怎么学习的? &nbsp; 如何报名? 只要购买了极简JAVA一:JAVA入门就算报名成功! &nbsp;本期为第四期极简JAVA学习营,我们来看看往期学员的学习状态: 作业看这里~ &nbsp; 助教的作业报告是不是很专业 不交作业打屁屁 助教答疑是不是很用心 &nbsp; 有奖抢答大家玩的很嗨啊 &nbsp; &nbsp; 项目答辩终于开始啦 &nbsp; 优秀者的获奖感言 &nbsp; 这是答辩项目的效果 &nbsp; &nbsp; 这么细致的服务,这么好的氛围,这样的学习效果,需要多少钱呢? 不要1999,不要199,不要99,只要9.9 是的你没听错,只要9.9以上所有就都属于你了 如果你: 1、&nbsp;想学JAVA没有基础 2、&nbsp;想学JAVA没有整块的时间 3、&nbsp;想学JAVA没有足够的预算 还等什么?赶紧报名吧,抓紧抢位,本期只招300人,错过只有等时间待定的下一期了 &nbsp; 报名请加小助手微信:eduxy-1 &nbsp; &nbsp;

Python数据清洗实战入门

本次课程主要以真实的电商数据为基础,通过Python详细的介绍了数据分析中的数据清洗阶段各种技巧和方法。

董付国老师Python全栈学习优惠套餐

购买套餐的朋友可以关注微信公众号“Python小屋”,上传付款截图,然后领取董老师任意图书1本。

linux下利用/proc进行进程树的打印

在linux下利用c语言实现的进程树的打印,主要通过/proc下的目录中的进程文件,获取status中的进程信息内容,然后利用递归实现进程树的打印

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

HoloLens2开发入门教程

本课程为HoloLens2开发入门教程,讲解部署开发环境,安装VS2019,Unity版本,Windows SDK,创建Unity项目,讲解如何使用MRTK,编辑器模拟手势交互,打包VS工程并编译部署应用到HoloLens上等。

150讲轻松搞定Python网络爬虫

【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑

MySQL 8.0.19安装教程(windows 64位)

话不多说直接开干 目录 1-先去官网下载点击的MySQL的下载​ 2-配置初始化的my.ini文件的文件 3-初始化MySQL 4-安装MySQL服务 + 启动MySQL 服务 5-连接MySQL + 修改密码 先去官网下载点击的MySQL的下载 下载完成后解压 解压完是这个样子 配置初始化的my.ini文件的文件 ...

Python数据挖掘简易入门

&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

网络工程师小白入门--【思科CCNA、华为HCNA等网络工程师认证】

本课程适合CCNA或HCNA网络小白同志,高手请绕道,可以直接学习进价课程。通过本预科课程的学习,为学习网络工程师、思科CCNA、华为HCNA这些认证打下坚实的基础! 重要!思科认证2020年2月24日起,已启用新版认证和考试,包括题库都会更新,由于疫情原因,请关注官网和本地考点信息。题库网络上很容易下载到。

Ubuntu18.04安装教程

Ubuntu18.04.1安装一、准备工作1.下载Ubuntu18.04.1 LTS2.制作U盘启动盘3.准备 Ubuntu18.04.1 的硬盘空间二、安装Ubuntu18.04.1三、安装后的一些工作1.安装输入法2.更换软件源四、双系统如何卸载Ubuntu18.04.1新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列...

sql语句 异常 Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your

在我们开发的工程中,有时候会报 [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ------ 这种异常 不用多想,肯定是我们的sql语句出现问题,下面...

西南交通大学新秀杯数学建模试题

题目比较难,如果符合大家的口味欢迎大家下载哈,提高你的思维想象能力

Windows版YOLOv4目标检测实战:训练自己的数据集

课程演示环境:Windows10; cuda 10.2; cudnn7.6.5; Python3.7; VisualStudio2019; OpenCV3.4 需要学习ubuntu系统上YOLOv4的同学请前往:《YOLOv4目标检测实战:训练自己的数据集》 课程链接:https://edu.csdn.net/course/detail/28745 YOLOv4来了!速度和精度双提升! 与 YOLOv3 相比,新版本的 AP (精度)和 FPS (每秒帧率)分别提高了 10% 和 12%。 YOLO系列是基于深度学习的端到端实时目标检测方法。本课程将手把手地教大家使用labelImg标注和使用YOLOv4训练自己的数据集。课程实战分为两个项目:单目标检测(足球目标检测)和多目标检测(足球和梅西同时检测)。 本课程的YOLOv4使用AlexyAB/darknet,在Windows系统上做项目演示。包括:安装软件环境、安装YOLOv4、标注自己的数据集、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算)和先验框聚类分析。还将介绍改善YOLOv4目标检测性能的技巧。 除本课程《Windows版YOLOv4目标检测实战:训练自己的数据集》外,本人将推出有关YOLOv4目标检测的系列课程。请持续关注该系列的其它视频课程,包括: 《Windows版YOLOv4目标检测实战:人脸口罩佩戴检测》 《Windows版YOLOv4目标检测实战:中国交通标志识别》 《Windows版YOLOv4目标检测:原理与源码解析》

Spring Boot -01- 快速入门篇(图文教程)

Spring Boot -01- 快速入门篇 今天开始不断整理 Spring Boot 2.0 版本学习笔记,大家可以在博客看到我的笔记,然后大家想看视频课程也可以到【慕课网】手机 app,去找【Spring Boot 2.0 深度实践】的课程,令人开心的是,课程完全免费! 什么是 Spring Boot? Spring Boot 是由 Pivotal 团队提供的全新框架。Spring Boot...

相关热词 c# dbml文件 修改 c#遍历tree c# 能够控制单片机 c#对象写入数据库 c# 添加activex c#2005 json c# 数据库在云端 c# 字符串移位加密 c#禁用滚轮 c#实体类list去重复
立即提问