Common SQL queries in Bianwu

Source: Internet
Author: User

First, the annual selection of Project statistics

--the annual selection of Project statistics,--content:--topic number Themeid, Version Impressions nthedition,nthpress, Project time Declaredate,--type (publication, reprint, reprint), topic Category 1, topic Category 2, Workshop (department)--Themetype 00 First edition, 01 reprint, 02 republication, 03 cooperation project--themetype1 Topic Category 1 01 reference map, 02 teaching aids, 03 books, 04 e-books, 05 special maps--themetype2 topic Category 2--Inteid Topic unique Id,statesname Current status--where Flowid = ' 200501060 ' indicates that the project has been completed and that the next process has been generated "departmental assignment". SelectA.themeid topic number,cast(a.nthedition as varchar)+'-'+cast(a.nthpress as varchar) version Impressions,Convert(varchar(Ten), A.declaredate, -) Project date, A.themetypename type, a.themetype1name Category 1, a.themetype2name Category 2, A.editorroomname Room, A.STATESN Ame current status,Convert(varchar(Ten), B.fagaodate, -) Date fromBw_theme A Left outer JoinBw_fagao b onA.inteid=B.themeinteidwhere exists(Select 1  fromBw_themetrack CwhereC.flowid='200501060'  andC.themeid=A.inteid) andA.declaredate is  not NULL     and  notA.themeid like 'c%'

Second, the difference between the left join in the SQL statement and the left outer join on, etc.

Http://www.cnblogs.com/cy163/archive/2008/10/16/1312920.html

Common SQL queries in Bianwu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.