SQL Server-Basic

Source: Internet
Author: User

Data type

    • Character type

varchar (8000): Supports up to 8,000 characters

nvarchar (4000): Supports up to 4,000 characters

    • Integral type

    • Floating point Type

Operators, functions

ISNULL (value,0);  --if NULL, the return value is 0sum (column); --Add this column value IsNumeric ("123")--non-numeric return 0, number returned 1

modifying fields

ALTER TABLE tname DROP COLUMN cname;  --delete field alter TABLE tname ADD CNAME VARCHAR (100);  --Add the field alter TABLE tname add DEFAULT (' no ') for the CNAME with VALUES; --Modify the field default value

SELECT statement

Go heavy

SELECT DISTINCT cname from tname WHERE ...;

Result set Query

SELECT * from Tname WHERE the CNAME in (' V1 ', ' v2 ');

If the result set is empty

SELECT * from Tname WHERE cname in ('); --cannot be written as in (), so there is a syntax error.

External connection

Outer joins are divided into three kinds: Left outer connection, right outer connection, full outer connection


This article is from the "Zero Technology Road" blog, please be sure to keep this source http://zerohou.blog.51cto.com/3019528/1615326

SQL Server-Basic

Related Article

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.