MVC

  • Home
  • HTML
    • Overview
    • Formatting
  • Java Script
    • Overview
    • Validation
  • CSS
    • Overview
  • Sql
    • Overview
    • SQL Select
    • SQL Command
    • Advance Query
    • SQL Create
    • Function
    • Function vs StoreProcedure
    • Stored Procedures
  • MVC
    • OverView
    • Evolution of MVC
    • Install VisualStudio-2015
    • Create First Application
  • LINQ
    • Introduction
  • Privacy Policy

Monday, 16 October 2017

Except vs NotNull in Sql Server

  Unknown       09:52       No comments    

EXCEPT & INTERSECT command in SQL Server


EXCEPT


In this Article EXCEPT command use to commind two queries and find dinctinct records. EXCEPT returns any left query values which are not exist in right query. You can use Except command and easily find distinct value of one table when you want filter values.

SYNTAX


The Syntax of EXCEPT command
SELECT ColumnName1,ColumnName2,....ColumnNameN FROM TableName1
EXCEPT
SELECT ColumnName1,ColumnName2,....ColumnNameN FROM TableName2

Note - You Should know about same number of column in all Queries Example of Except Command in SQL server you can more clear in example
Example
. SELECT * from Table1
EXCEPT
select * from Table2
Note -You can write this query and execute (f5) after that You got result 'name which is ditinct and not match in right table.'
Result - You can see output record.
Image

Intersect


In this Article Intersect command use to commind two queries and find common records. You can use Intersect command and easily find common values.

SYNTAX


The Syntax of Intersect command
SELECT ColumnName1,ColumnName2,....ColumnNameN FROM TableName1
Intersect
SELECT ColumnName1,ColumnName2,....ColumnNameN FROM TableName2

Note - You Should know about same number of column in all Queries Example of Intersect Command in SQL server you can more clear in example
Example
SELECT * from Table1
INTERSECT
select * from Table2
Note -You can write this query and execute (f5) after that You find result 'name which is common in both table.'
Result - You can see output record.
Image

What is a NULL Value in Sql?


In this tutorial we describe that NULL value is a field with does not have any value. You can Insrt a new record and update without any value then field have 'no value' and field will be saved with a NULL value
Note - NULL value is different from a zero value or a field that contains spaces. A field with a NULL value is one that has been left blank during record creation.

What is Not NULL Value in Sql?


In this tutorial we describe that Not NULL value is a field which have value ,doesn't null value.

Difference between Except vs Not In

Except


EXCEPT filters the DISTINCT values from the left-hand table that do not appear in the right-hand table. It's essentially the same as doing a NOT EXISTS with a DISTINCT clause.
It also expects the two tables (or subset of columns from the tables) to have the same number of columns in the left and right hand side of the query

NOT IN

NOT IN does not filter for DISTINCT values and returns all values from the left-hand table that do not appear in the right-hand table.
NOT IN requires you compare a single column from one table with a single column from another table or subquery.
For example, if your subquery was to return multiple columns:
SELECT * FROM TableA AS nc WHERE ID NOT IN (SELECT ID, Name FROM TableB AS ec)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
Email This BlogThis! Share to X Share to Facebook
Newer Post Older Post Home

0 comments :

Post a Comment

learningmvctutorial

Popular Posts

  • Overview
      SQL (Structured Query Language)   SQL  is a language that interacts with the database on the server-side. This dynamite duo has changed ...
  • Overview of HTML
    What is HTML? First developed by Tim Berners-Lee in 1990 . HTML is used to create electronic documents (called pages) that are displ...
  • Difference Between function v/s store procedure
    Definition  of Store Procedure In a database management system (DBMS), a  stored procedure  is a set of Structured Query Language (SQL...
  • What is LINQ
    LINQ  (Language Integrated Query) is a Microsoft programming model and methodology that essentially adds formal query capabilities into Mic...
  • SQL Select
    The SQL SELECT Statement The SELECT statement is used to select data from a database. SQL SELECT Syntax SELECT column_name , column_n...
  • What is Function in Sql Server
    A function is a block of code that has a name and it has a property that it is reusable. We use function in store Procedure and queries in...
  • Create Duplicate Table of existing table in SQL Server
    In This Tutorial we create table and want to same structure and same data then We create new table with data type after that  insert in ta...
  • About Javascript
    What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting langua...
  • Operator in JavaScript
    What is an operator? JavaScript has both binary and unary operators, and one special ternary operator, the conditional operator. A binar...
  • Create First Application in MVC
    We want to create Firstly application in MVC first of how we create first application Show Steps   as below-     STEP 1 .  Start Computer ...

Blog Archive

  • ▼  2017 ( 35 )
    • ►  November ( 1 )
    • ▼  October ( 2 )
      • Except vs NotNull in Sql Server
      • Sql Commands
    • ►  September ( 4 )
    • ►  August ( 1 )
    • ►  July ( 1 )
    • ►  May ( 3 )
    • ►  April ( 7 )
    • ►  March ( 13 )
    • ►  February ( 3 )
Powered by Blogger.

Categories

  • AdvanceQuery
  • CreateApplication
  • CreateDb
  • CssOverview
  • Evolution
  • Formatting
  • Function
  • FunctionVSSp
  • HtmlOverview
  • InstallVisualStudio
  • Introduction
  • javascriptOverview
  • JsValidation
  • Mvc-vs-Asp.Net
  • OverView
  • Select
  • SqlCommand
  • SQLOverview
  • StoredProcedures

Text Widget

Sample Text

Pages

  • Home

Copyright © MVC | Powered by Blogger
Design by Vibha Acharya