Which SQL statement is the trump card to the senior software developer
                    
MA Genfeng  
       (Guangdong Unitoll Services incorporated, Guangzhou 510300)

Abstract     Within so many kinds of DML statements in SQL, I think four kinds of them, including Case When, Left Outer Join/Left Join / Right Outer Join /Right Join/ Inner Join, WITH AS and UNION/UNION ALL, are essential for the Database Developer.

In fact, there is a kind of SQL statement which might be the trump card to the senior software developer.I can say, immodestly, that quite a few software developers would never get the chance to use it solving a task that they might encount in their work . This is Full Outer Join.

Key words  DB Query Analyzer; Full Outer Join; UDA; Data Access

0   Perface 

Nowadays, the application of computers has penetrated into all spheres of society. Software developers have to meet with data process and data access.

Within so many kinds of DML statements in SQL, I think four kinds of them, including Case When, Left Outer Join/Left Join / Right Outer Join /Right Join/ Inner Join,WITH AS and UNION/UNION ALL, are essential for the Database Developer.

I've writen four articles correspond to the four kinds of DML statements above which have already been published in my CSDN Blog, Sina Blog,QQ Space, Sohu Blog, CSDN Resource and Baidu Library.The four articles in my CSDN Blog have more than 1000 views each. What's more,I've writen an article in which those four kinds of DML statements are all used for solving a task in my work. The views reached a record more than 11000.

http://blog.csdn.net/magenfeng/article/details/8126418

In fact, there is a kind of SQL statement which might be the trump card to the senior software developer.I can say, immodestly, that quite a few software developers would never get the chance to use it solving a task that they might encount in their work . This is Full Outer Join.

The FULL OUTER JOIN keyword returns all rows from the left table (table1) and from the right table (table2).

SQL FULL OUTER JOIN Syntax

SELECT column_name(s)

FROM table1

FULL OUTER JOINtable2

ON table1.column_name=table2.column_name;

1   Brief introduction DB Query Analyzer

DB Query Analyzer is presented by Master Genfeng, Ma from Chinese Mainland. It has English version named ‘DB Query Analyzer’ and Simplified Chinese version named   .

DB Query Analyzer is one of the few excellent Client Tools in the world for its’powerful function, friendly interface, easy operation and applicability to every production of RDBMS.

It lets you query ODBC data sources, author SQL scripts and queries, return query results to a grid or free-form text or a file, retrieve ODBC driver information, execute multiple SQL scripts or stored procedures simultaneously, and more.

In the New products & Tools reviews of programmer second issue of 2007, DB Query Analyzer had been strongly recommended.

Now the Simplified Chinese version of DB Query Analyzer is the top 50 database application software in the famous software website http://xiazai.zol.com.cn/download_order/sub_550.html . In most case it lies the top 20 and it has been download more than 96,000 times.

63 technical articles about DB Query Analyzer have been published or been publishing in computer journal, BAIDU Library, the CSDN resource or my four blog-websites.

Download and install DB Query Analyzer. Then run it and input the DSN ’MGF_DB1’,User Name and Password.

2   What’s question to be solved

I work for Guangdong Unitoll Services incorporated, which is authorized to be engaged in Expressway Network Toll Collection in Guangdong Province. Each vehicle's toll data will be uploaded to our corporation by Every Highway Corporation. We must split all the tolls to each Highway Corporation by some rules. But another corporation developed a software system in which tolls splitting is also been done by their rules for a certain Highway Corporation.

So those Highway Corporations will often found many differences between thus two tolls splitting system.

I was arranged to find out what's the cause of the difference.

After careful thought, I decide to use two data granularity levels to describe the differences. The high granularity level tables show tolls splitting between those Highway Corporations. The low granularity level tables show detail splitting information of each vehicle's toll data in thus two tolls splitting system. I generated the result table data by Full Outer Join which will discover all the record

3   The process of the question be solved Detailedly

Because DB Query Analyzer access database/CSV/TXT/MS EXCEL by ODBC DSN, you should create ODBC DSN first.In here the process of the creation of ODBC DSN is omitted.

Tables in database include

dbo.SplitResultList           Low granularity level table

dbo.SplitResultList_stat        High granularity level table

dbo.TB_CASHACCURATESPLITRESULT1   Low granularity leveltable

dbo.tb_cashaccuratesplitresult1_stat        High granularity level table

dbo.split_comp

Table dbo.SplitResultList and dbo.SplitResultList_statare according to another corporation.

Table dbo.TB_CASHACCURATESPLITRESULT1 and dbo. tb_cashaccuratesplitresult1_stat are according to our corporation.

Table dbo.split_compis generated by me to show tolls splitting for each tolls splitting system.

Figure 1     Run DB Query Analyzer to log in the databaseby ODBC

Figure 2       Tables in the database connected

Figure 3    Faster SQLScript generated by Object View to access SplitResultList

Figure4 Faster SQL Script generated by Object View to access TB_CASHACCURATESPLITRESULT1

Figure 5    Faster SQL Script generated by Object Viewto access SplitResultList_stat

Figure 6 Faster SQL Script generated by Object View to access tb_cashaccuratesplitresult1_stat

Figure7    SQL script with Full Outer Join to generate the detail level data of split_comp

selecta.*,b.*  into split_comp

--selectcount(*)

from

(

select *

from tb_cashaccuratesplitresult1_stat

)as a  full outer  join

(

select *

from SplitResultListmid_stat

)  as b

on a.outlistno=b.outlistno_xy anda.incroadno=b.incroadno_xy

;

Figure 8    Faster SQL Script generated by Object View to access split_comp

 

4   63 technical articles about DB Query Analyzer have been published or been publishing in computer journal, Baidu Library, the CSDN resource or my four blog-website.

The following 6 articles have been published in computer journal.

DB Query Analyzer to cancel a running SQL statement in Computer Era 12th issue of 2011 in Hangzhou.

DB Query Analyzer Returns Information in More Detail While Batch SQL Statement End of Execution in Computer Programming Skill & Maintenance 24th issue of 2011 in Beijing

The Application of the Transactions Control in DB2 with DB Query Analyzer in Computer Programming Skill & Maintenance 22nd issue of 2011 in Beijing.

How does DB Query Analyzer cancel the SQL statement committed to DBMS in Computer Engineering & Software 6th issue of 2011 in Tianjin.

The Application of the Transactions Control in Oracle with DB Query Analyzer in Microcomputer Applications 11th issue of 2011 in Shanghai.

DB Query Analyzer had been strongly recommended In the New products & Tools reviews of programmer 2nd issue of 2007.

The following 57 articles have been published or been publishing in Baidu Library, the CSDN resource or my four blog-website.

The DBMS that DB Query Analyzer Users often use cover all kinds of DBMS have been published.

How to configure ODBC DSN in Client to access remote DB2 for Windows

How to configure ODBC DSN to access local DB2 for Windows

Which SQL statement is the trump card to the senior software developer

Exe packer prevent DB Query Analyzer from being debugged have been published.

13 articles from The 1st tip of DB Query Analyze to The 13th skills of DB Query Analyzer have been published.

The table name must be enclosed in double quotation marks or square bracket while accessing EXCEL by DB Query Analyzer

DB Query Analyzer 5.04 download URL:

http://xiazai.zol.com.cn/detail/43/420901.shtml

http://www.unitedpowersoft.com/UpFile/DBQueryAnalyzer_English_503.rar

DB Query Analyzer Simplified Chinese version 5.04  download URL:

http://xiazai.zol.com.cn/detail/27/264455.shtml

Remarks :

Please uninstall the former version first, then install the latest version.

My blog-sites are http://blog.csdn.net/magenfeng

http://blog.sina.com.cn/magenfeng

http://user.qzone.qq.com/630414817

http://blog.csdn.net/magenfeng/article/details/8126418

The views of the article reached a record more than 11000


Which SQL statement is the trump card to the senior software developer的更多相关文章

  1. Drop all the tables, stored procedures, triggers, constraints and all the dependencies in one SQL statement

    Is there any way in which I can clean a database in SQl Server 2005 by dropping all the tables and d ...

  2. java.sql.preparedstatement和java.sql.statement的区别

    本文转自CSDN,然后整理了一遍.原文出处:CSDN JDBC(java database connectivity,java数据库连接)的api中的主要的四个类之一的java.sql.stateme ...

  3. 直接放个DB2 SQL STATEMENT大全好了!

    SQL statements   This topic contains tables that list the SQL statements classified by type. SQL sch ...

  4. MyBatis3: Could not find SQL statement to include with refid ‘

    错误: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.Incompl ...

  5. ORA-06550:line 1,column 7;PLS-00201:indentifer '存储过程' must be declared;...PL/SQL Statement ignored 问题

    前段时间由于修改SMES系统,出现了一个问题. ORA-06550:line 1,column 7;PLS-00201:indentifer '存储过程' must be declared;...PL ...

  6. 什么是SQL statement?

    什么是SQL statement? 1.SQL SELECT statement - SELECT命令 REFER: What is SQL, and what are some example st ...

  7. Viewing the Raw SQL Statement(xcode で)

    Thanks to Core Data. Even without learning SQL and database, you’re able to perform create, select, ...

  8. Caused by: org.h2.jdbc.JdbcSQLException: Table "T_STUDENT_INFO" not found; SQL statement

    1.错误描述 org.hibernate.exception.SQLGrammarException: error executing work at org.hibernate.exception. ...

  9. Error 1313: RETURN is only allowed in a FUNCTION SQL Statement

    1.错误描述 14:07:26 Apply changes to rand_string Error 1313: RETURN is only allowed in a FUNCTION SQL St ...

随机推荐

  1. FFmpeg的H.264解码器源代码简单分析:解码器主干部分

    ===================================================== H.264源代码分析文章列表: [编码 - x264] x264源代码简单分析:概述 x26 ...

  2. iOS中 CocoaPods Mac App的安装和使用 韩俊强的博客

    CocoaPods Mac App的安装和使用 CocoaPods桌面应用版下载地址:https://cocoapods.org/app打开应用会提示你是否安装命令行工具,选择install就也可以在 ...

  3. acm入门搜索-水池数目

    水池数目 时间限制:3000 ms  |  内存限制:65535 KB 难度:4 描述 校园里有一些小河和一些湖泊,现在,我们把它们通一看成水池,假设有一张我们学校的某处的地图,这个地图上仅标识了此处 ...

  4. Mybatis3.4.0不支持mybatis-spring1.2.5及以下版本

    今天将工程的Mybatis的版本由3.3.0升级到3.4.0导致程序运行错误,使用的mybatis-spring版本是1.2.3,错误内容如下,最后发现是SpringManagedTransactio ...

  5. Dynamics CRM2013/2015 Plugin注册工具Register New Assembly时无法看到注册按钮的解决办法

    CRM2013的注册插件工具UI相比2011之前有了一定的改变,但改变UI的同时也给开发人员带来了困扰,打开注册工具点击Register按钮选择dll时页面就是下面这样的,你完全看不到最下面的两个按钮 ...

  6. Android 导入v7包常见错误,以及项目引用v7包错误解决

    android下v4    v7   v21等包是android系统的扩展支持包,就想windows的系统补丁一个道理. android的扩展包主要是用来兼容低版本的,比如android3.0以后出现 ...

  7. 学习笔记-JS公开课一

    JS公开课笔记 没特别说明就是和Java语言一样. JS变量:弱类型语言 1.在JS中,true表示1,false表示0.和Java不一样. 2. var y: 提示undefined: 3.如果al ...

  8. [Java]数组排序-选择排序 冒泡排序 插入排序

    1 选择排序  原理:a 将数组中的每个元素,与第一个元素比较          如果这个元素小于第一个元素, 就将这个         两个元素交换.       b 每轮使用a的规则, 可以选择出 ...

  9. ubuntu wubi.exe 直接加载下载好的 amd64.tar.xz

    玩了这么久的LINUX,一直都是直机装UBUNTU,虚一下XP的,后来不得不直机用WIN7,只能WUBI装一下UBUNTU了.不得不说,在WIN7下虚一个UBUNTU真是相当麻烦.网络那块很是难搞,而 ...

  10. Android JSON原生解析的几种思路,以号码归属地,笑话大全,天气预报为例演示

    Android JSON原生解析的几种思路,以号码归属地,笑话大全,天气预报为例演示 今天项目中要实现一个天气的预览,加载的信息很多,字段也很多,所以理清了一下思路,准备独立出来写一个总结,这样对大家 ...