1. Summarize the syntax for querying 10-20 Records in Oracle, SQL Server, and MySQLOne: Oracle database notation:1:select * FROM (select RowNum RN, * from table name wher rownumwhere a.rn>102:select * FROM table name where rownumMinusSELECT * FROM table name where rownumII: SQL Server database notation:1:select Top * FROM tablename where ID not?exists (select Top
objects queried, this query queries the number of child objects of a 1 record
$exists Query
Db.colls.find ({A: {$exists: true}}); There is data for the A object
Db.colls.find ({A: {$exists: false}}); There is no data for the A object
$type Query the type value of the $type value to bsonhttp://bsonspec.org/data
Db.colls.find ({A: {$type: 2}}); Match A to string type data
Db.colls.find ({A: {$type: 16}}); Match A to int type data
Using regular expression matching
: Http://submain.download.csdn.net/
You can also directly copy the following content and save the file as "SQL. stx ".
# TITLE = SQL; SQL syntax file written by BUGSoft (BUGSoft@126.com ).
# DELIMITER =, () {} []-+ * %/= "'~! | # QUOTATION1 ='# QUOTATION2 ="# LINECOMMENT = --# COMMENTON = /*# COMMENTOFF = */# SPECIA
SQL BETWEEN syntax and BETWEEN example tutorialThe BETWEEN operator is used in the WHERE clause to select a range of data between two values.
BETWEEN operatorOperator BETWEEN ... and selects a range of data between two values. These values can be numeric, literal, or date.
SQL BETWEEN SyntaxSELECT column_name (s)From table_nameWHERE column_nameBETWEEN value1 an
Tags: Type=myisam sql mariadb650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7B/41/wKiom1bJGZKT0yHAAAC5XwL9MQo508.png "title=" 5555. PNG "alt=" Wkiom1bjgzkt0yhaaac5xwl9mqo508.png "/>Back up the script file before operation:Find the SQL script and execute it (take Aaa.sql for example)Sed-i ' s/type=myisam/engine=myisam/g ' Aaa.sql # # #aaa. SQL is a sto
Recently, in the group, everyone suddenly discussed that FB (Firebird) was coming. Oh, after reading some information, I suddenly found this thing quite interesting. So I began to look for a lot of relevant information, below are some of the SQL statements in FB, which are transferred from the Internet. You may have a look at them and I will sort them out in a few days. use the FB demo under. Net to show you the support.
I. Paging
1. Data Definition ddl (datadefinitionlanguage) data definition language refers to the language defined for the format and form of data. it is the first thing that every database needs to face when it is created, the table relationships, column primary keys in the table, and the reference relationships between tables are all planned at the beginning. I. data definition language)
A document language is a language defined for the format and form of a document. it is the first thing that every dat
Tags: share picture where go to heavy distinct SEL SID student. com query1. Select: Used to select data from the databaseSELECT Name,value from table_name2.SELECT DISTINCT statement for returning a unique value (de-weight)The 3.WHERE clause is used to filter records.SELECT Column_name,column_name from table_name WHERE column_name operator value;Query the name of the student with Sid ' 01 ' From the Student table:The 4.AND or operator is used to filter records based on more than one conditionAn
Tags: LSE WOT form ROP ENC war composite case pathIn the previous chapters we talked about: if the data for a table is a union of multiple tables, and there is a merge of columns and columns to form a new column, the view is the best scenario.Below I share two real SQL statement cases Usewot_inventoryGOIF EXISTS(SELECT 1 fromSys.viewsWHEREName= 'Invoicesearchlistview') DROP VIEWInvoicesearchlistview;GOCREATE VIEWInvoicesearchlistview as SELECTRow_
Select to_date ('20090210','YYYYMMDD') fromDual------General Function--NVL () functionSelectNVL (Comm,1) fromEMP-----------------------------------------------------------------
--Fuzzy query likeSelect* fromEMPSelect* fromEMPwhereJob like'%*_%'-----logical Operators--Select all information for employees in department 30Select* fromEMPwheredeptno= -;
--The number of the employee who listed the position as (MANAGER), nameSelectEmpno,ename fromEMPwherejob='MANAGER'--find employees with bonuses ab
Tags: select Set sel mail warnings and end highlight conditionUPDATE ' Warningsendmail ' as Alias_1 INNER JOIN (SELECT * from ' Warningsendmail ' WHERE flag=1 and topic_id like "%2267%") A S alias_2 SET alias_1.topic_id = REPLACE (alias_1.topic_id, ' |2267 ', ') WHERE alias_1.id = alias_2.id
update Warningsendmail set topic_id= REPLACE (topic_id, ' |2267 ', ') where ID in (SELECT ID from warningsendmail where flag=1 and T opic_id like "%2267%");
SQL
SQL Basic Syntax:Http://www.cnblogs.com/lyhabc/p/3691555.htmlSQL data type width:SQL data type width: http://www.cnblogs.com/lyhabc/p/3696629.htmlSQL Basic Syntax:Http://www.cnblogs.com/lyhabc/p/3691555.htmlSQL Basic Syntax:Http://www.cnblogs.com/lyhabc/p/3691555.htmlSQL Basic Syntax:Http://www.cnblogs.com/lyhabc/p/3691555.htmlSQL Basic Syntax:Http://www.cnblogs.com/lyhabc/p/3691555.htmlSQL Basic Syntax:Http://www.cnblogs.com/lyhabc/p/3691555.htmlSQL
SELECT * from the users ORDER by name
Db.users.find (). Sort ({name:-1})
Sort
SELECT * from Users ORDER by name DESC
Db.users.find (). Sort ({name:-1})
Sort
EXPLAIN SELECT * from Users where z=3
Db.users.find ({Z:3}). Explain ()
Get Storage Path
Update users set a=1 where b= ' Q '
Db.users.update ({b: ' Q '}, {$set: {a:1}}, False, True)
Update record
Update users set a=a+2 where b= ' Q
SQL connections can be divided into internal, external, and cross-joins.1. Internal connection: Inner Join the query operation lists the data rows that match the join criteria, which uses comparison operators to compare the column values of the concatenated columns.1.1 SELECT * from Table1 as a, Table2 as B where a.id= b.id1.2 SELECT * FROM Table1 as a inner joins Table2 as B on a.id = b.ID
External connection2.1 Left OUTER join (simply put, lef
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.