sql
sxf_0123
这个作者很懒,什么都没留下…
展开
-
sql语句用法常用(inner join,left join,right join,cross join)
例子: a表 id name b表 id job parent_id 1 张3 1 23 1 2 李四 2 34 2 3原创 2017-07-22 09:45:46 · 342 阅读 · 0 评论 -
oracle中使用sql语句将date日期7月21日2017类型转换为7/21/2017
将表table中的date日期7月21日2017类型转换为7/21/2017select to_char(date,'yyyyMMddHHmmss') from table;原创 2017-07-22 09:55:05 · 1210 阅读 · 0 评论 -
oracle中sql语句(+)符号代表连接
oracle中sql语句(+)符号代表连接(+)在=前边为右连接(+)在=后边为左连接SELECT a.*, b.* from a(+) = b就是一个右连接,等同于select a.*, b.* from a right join bSELECT a.*, b.* from a = b(+)就是一个左连接,等同于select a.*, b.* from a left join b原创 2017-12-06 17:10:03 · 749 阅读 · 0 评论 -
Oracle中的SUM条件查询
1、按照区域编码分组查询区域编码、IPTV_NBR不为空的数量、ACC_NBR不为空的数量、所有用户数量SELECTAREA_CODE,SUM (CASEWHEN IPTV_NBR IS NULL or IPTV_NBR = '' THEN0ELSE1END),SUM (CASEWHEN ACC_NBR IS NULL or ACC_NBR =原创 2018-01-23 14:49:40 · 11578 阅读 · 0 评论 -
python3连接mysql及批量插入数据
#!/usr/bin/env python# -*- coding: utf-8 -*-# @Time : 2018/4/13 0013 16:33# @Author :# @QQ : # @File : py_con_mysql.py# @Software: PyCharm Community Edition"""python connect mysql...原创 2018-04-16 15:04:34 · 7027 阅读 · 0 评论 -
坑惨了!flink执行sql语句时,出现com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE
出现错误!Data truncation: Truncated incorrect DOUBLE value: '2018-10-18 19:21:47'Flink操作mysql数据库对数据进行更新时。原始sql语句:update t_lianlu_utilization_alarm set cancle_time=? and recevicetime=? where devic...原创 2018-10-18 19:55:23 · 3524 阅读 · 0 评论 -
mysql连接出现Too many connections异常
异常:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Too many connections at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeCo...原创 2018-10-23 10:55:44 · 1027 阅读 · 0 评论 -
mysql 批量查询
sql = "SELECT area_id,area_name FROM `t_area_info` WHERE area_id IN ({mark})".format( mark=','.join(["%s"] * 1000))with conn.cursor() as cursor: new_sql = sql % tuple(value_list) #需要将v...原创 2019-03-09 15:00:29 · 1459 阅读 · 1 评论