Database SQL statements

Source: Internet
Author: User

Change and delete

--IncreaseCreateINSERT  intoTABLE_NAME (column 1, column 2,...)VALUES(value 1, value 2,....)--DeleteDeleteDELETE  fromTable nameWHEREColumn Name=value--Delete all RowsDELETE  fromtable_nameDrop--ModifyUpdateUPDATETable nameSETColumn Name=New valueWHEREColumn Name=a valueUPDATEPersonSETFirstName= 'Fred' WHERELastName= 'Wilson' --EnquirySelect *   from TableSelect distinctCol from TableSelect *   from TableTwhereT.no=XxxGroup  byT.no having Order  by ASC descSELECTcolumn_name, Aggregate_function (column_name) fromtable_nameWHEREcolumn_name operator ValueGROUP  bycolumn_name havingaggregate_function (column_name) operator value--where like like %Abc% like -A%--Date FunctionSelectTo_date ('2005-01-01 13:14:20','YYYY-MM-DD HH24:mm:ss') fromdual;--text FunctionsSelectTo_char (Sysdate,'YYYY-MM-DD HH24:mi:ss') fromdual;--NULL 1 functionNVL (NULL,1) NVL (EXP1,EXP2): When expression one is null, return expression two Nvl2 (EXP1,EXP2,EXP3): return expression Three when expression one is null, otherwise return expression twoNullif(EXP1,EXP2): Returns null if two expressions are equal, otherwise returns the expression one--self-increment sequence

Reference @http://blog.sina.com.cn/s/blog_b5d14e2a0101c56z.html

Database SQL statements

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.