随笔分类 -  SQL

摘要:Work with recursive CTEs bookmark_border In GoogleSQL for BigQuery, a WITH clause contains one or more common table expressions (CTEs) with temporary 阅读全文
posted @ 2023-09-11 18:01 po-A 阅读(97) 评论(0) 推荐(0)
摘要:Formats for quoted literals The following table lists all of the ways you can format a quoted literal. LiteralExamplesDescription Quoted string "abc" 阅读全文
posted @ 2023-09-11 15:43 po-A 阅读(115) 评论(0) 推荐(0)
摘要:IF CURSOR_STATUS('global', 'mycursor') >= 0BEGIN PRINT 'Cursor exists and is open';ENDELSEBEGIN PRINT 'Cursor does not exist or is not open';END; REF: 阅读全文
posted @ 2023-03-31 12:09 po-A 阅读(206) 评论(0) 推荐(0)
摘要:Creating a temporary table The following example creates a temporary table named Example and inserts values into it. CREATE TEMP TABLE Example( x INT6 阅读全文
posted @ 2023-02-01 15:43 po-A 阅读(380) 评论(0) 推荐(0)
摘要:VALUES Statement | 6.3.x | Cloudera Documentation SELECT now() as date_DES UNION ALL SELECT trunc(now(), 'month') union all select date_sub(trunc(now( 阅读全文
posted @ 2023-01-16 22:27 po-A 阅读(129) 评论(0) 推荐(0)
摘要:【转载须知】转载请标注本文链接。 Kettle版本:7.1 E:\迅雷下载\Kettle-pdi-ce-7.1.0.0-12\data-integration 运行spoon.bat 新建-数据库 报错内容: org.pentaho.ui.xul.XulException: org.pentaho. 阅读全文
posted @ 2020-06-15 17:39 po-A 阅读(6502) 评论(2) 推荐(3)
摘要:有表A,结构如下: A: p_ID p_Num s_id 1 10 01 1 12 02 2 8 01 3 11 01 3 8 03 其中:p_ID为产品ID,p_Num为产品库存量,s_id为仓库ID。请用SQL语句实现将上表中的数据合并,合并后的数据为: p_ID s1_id s2_id s3_ 阅读全文
posted @ 2020-06-11 12:38 po-A 阅读(312) 评论(0) 推荐(0)
摘要:【转载须知】转载请标注本文链接地址。 安装包:mysql-installer-community-8.0.20.0.msi MySQL安装版本:8.0.20 环境:WIN 7 -64位 安装MySQL server时,Creating uer accounts时报错: Attempting to s 阅读全文
posted @ 2020-06-02 17:31 po-A 阅读(14029) 评论(4) 推荐(1)
摘要:下载: https://www.cloudera.com/downloads/connectors/hive/jdbc/2-5-20.html 手册: https://community.cloudera.com/t5/Community-Articles/Connect-Oracle-SQL-De 阅读全文
posted @ 2020-05-20 17:39 po-A 阅读(657) 评论(0) 推荐(0)
摘要:ref: https://blog.csdn.net/xiaolinyouni/article/details/6943337 现在有一个表student 结构如下:id name class blood1 张三 1 A2 李四 2 C3 王五 1 B4 黄六 3 D5 朱八 2 C现在想查询出每个 阅读全文
posted @ 2020-04-01 13:28 po-A 阅读(433) 评论(0) 推荐(0)
摘要:REF: https://blog.csdn.net/weixin_30745641/article/details/101745371?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_rele 阅读全文
posted @ 2020-03-31 16:47 po-A 阅读(176) 评论(0) 推荐(0)
摘要:ref:https://www.cnblogs.com/cy163/archive/2008/10/16/1312920.html 2.3.4 外连接与条件配合使用当在内连接查询中加入条件是,无论是将它加入到join子句,还是加入到where子句,其效果是完全一样的,但对于外连接情况就不同了。当把条 阅读全文
posted @ 2020-03-31 14:18 po-A 阅读(661) 评论(0) 推荐(0)
摘要:https://clouddamcdnprodep.azureedge.net/gdc/gdcJivzXl/original 阅读全文
posted @ 2020-03-26 12:24 po-A 阅读(1577) 评论(0) 推荐(0)
摘要:例子: CREATE TABLE [dbo].[testDT]( [bh] [varchar](50) NULL, [name] [varchar](50) NULL, [gender] [int] NULL, [email] [varchar](50) NULL ) 测试数据:12 li 1 12 阅读全文
posted @ 2020-03-26 11:45 po-A 阅读(409) 评论(0) 推荐(0)
摘要:在SQL SERVER 2008R2的[AdventureWorks2008R2]示例数据库中,看到以下字段统一补0方法。 将CustomerID前面加0转变为AccountNumber字段。 CREATE TABLE [Sales].[Customer]( [CustomerID] [int] I 阅读全文
posted @ 2018-12-15 14:46 po-A 阅读(3008) 评论(0) 推荐(0)
摘要:解决方案/Solution: 报错描述: SQL Service BI development studio 创建新项目时,报错:(报错截图如下) Microsoft visual studio is unable to load this document.To design Integratio 阅读全文
posted @ 2018-11-28 11:14 po-A 阅读(442) 评论(0) 推荐(0)
摘要:SQL SERVER 2008 安装过程中, 进行到server configuration步骤, 报错 “The credentials you provided for the SQL Server Agent service are invalid.”解决方案如下: 报错内容示例: The s 阅读全文
posted @ 2018-11-28 10:05 po-A 阅读(8321) 评论(0) 推荐(0)
摘要:现在有excel一些数据,需要复制到table中。 Period TransDate Amount2018001 2018-01-02 -4013.22 将excel中日期格式设置为自定义yyyy-mm-dd。举例,当你在excel中设置自定义格式为mm/dd/yyyy, sql server默认的 阅读全文
posted @ 2018-06-05 13:33 po-A 阅读(1657) 评论(0) 推荐(0)
摘要:MS SQL处理“分子分母都有除法式”方法,避免devide by zero error: eg: 有4列值,分别为A,B,C,D.我们需要求(A/B)/(C/D)的值作为新的一列。 只用ISNULL处理,可能会报错devide by zero error. “divide by zero” err 阅读全文
posted @ 2016-05-04 13:42 po-A 阅读(871) 评论(0) 推荐(0)
摘要:SQL中把筛选条件放在left outer join的on 和 where 后面的区别 create table [Table_1]([PKey] int,[FKey] int,[value1] int,[value2] int)create table[Table_2]([PKey] int,[v 阅读全文
posted @ 2016-04-21 14:35 po-A 阅读(4049) 评论(0) 推荐(0)

Tushare大数据开放社区-免费提供各类金融数据和区块链数据 , 助力智能投资与创新型投资。

Python, Matlab, R, Web数据抽取学习交流。