1 select * from (select * From dbo.xcqy2017_article where kind= 53 ) as T1 2 left Span style= "COLOR: #808080" >join (select * from dbo.xcqy2017_news_classification) As T2 on T2. Ncid = t1. Ncid
left join left link to left table Main Table
1 select * from (select * From dbo.xcqy2017_article where kind= 53 ) as T1 2 right Span style= "COLOR: #808080" >join (select * from dbo.xcqy2017_news_classification) As T2 on T2. Ncid = t1. Ncid
Right- Join link to right table for main Table
1 SELECT 2 Case 3 whenKind= - Then 'News Update' 4 whenKind= - Then 'News Update'5 ELSE 'other' 6 END 'News Update 1'7,* fromDbo.xcqy2017_article
Case-then- ELSE End condition Query
The UNION operator is used to combine the result set of two or more SELECT statements. Note that the SELECT statement inside the UNION must have the same number of columns. The column must also have a similar data type. Also, the order of the columns in each SELECT statement must be the same.
Union operator By default, the union operator chooses a different value. If duplicate values are allowed, use UNION all.
The UNION ALL operator is always the column name in the union result set equal to the column name in the first SELECT statement in the Union.
The except operator except operator derives a result table by including all rows in TABLE1 but not in TABLE2 and eliminating all duplicate rows. When all is used with EXCEPT (EXCEPT all), duplicate rows are not eliminated (it is not known if it can be done, because of the version issue, the test was unsuccessful).
Select Ncid from Dbo.xcqy2017_article EXCEPT SELECT ncid from Dbo.xcqy2017_news_classification
List all the fields in the table
NEWID () Random ID sort
SELECT * from Dbo.xcqy2017_article ORDER by NEWID ()
SQL Consolidation Accumulation