The SQL input consists of a series of commands . An order consists of a series of tokens , with a semicolon (";") End. The termination of the input stream also ends a command. Which tokens are valid depends on the syntax of the particular command.A
In order to find this information, I can work hard to find a possible Bug in PostgreSQL, and check the source code of PostgreSQL to guess how to obtain fields with the auto-growth attribute. But the overall feeling is much more reasonable than the
Mysqlnotin, leftjoin, ISNULL, and NOTEXISTS efficiency issue records. For more information, see.
Mysql not in, left join, is null, not exists efficiency issue records. For more information, see.
Comparison of not in, JOIN, is null, not exists
Comparison of Oracle, mysql, sqlserver, and postgresql statements, postgresql and oracle
1. Paging
Oracle:SELECT * FROM (select a. *, rownum rn from (select T. * from sj_receiptinfo t WHERE t. taxno like concat ('%', CONCAT (?, '%') Order by t. id
1. PagingOracle: SELECT * FROM (select A.*, ROWNUM RN from (select t.* to Sj_receiptinfo T WHERE t.taxno like CONCAT ('% ', CONCAT (?, '% ')) ORDER BY t.id Desc) A WHERE ROWNUM ) WHERE RN >?MySQL: SELECT * from TableName where conditions Limit(
I have to say that at this point, PostgreSQL is very powerful and no less powerful than any large commercial database. It is not that complicated to add custom functions.
The following example adds the following functions: Test (), concat_text
1.Postgresql SQL statements for several previous recordsSELECT * FROM table where ... LIMIT N ; 2.SQL Limit integer Offset integer: the need to query the middle data in a database is often used.For example, the following SQL statement:①select * from
1. PagingOracle: SELECT * FROM (select A.*, ROWNUM RN from (select t.* to Sj_receiptinfo T WHERE t.taxno like CONCAT ('% ', CONCAT (?, '% ')) ORDER BY t.id Desc) A WHERE ROWNUM ?MySQL: SELECT * from TableName where conditions Limit( Current page
Comparison of Oracle, mysql, sqlserver, and postgresql statements
1. Paging
Oracle:SELECT * FROM (select a. *, rownum rn from (select T. * from sj_receiptinfo t WHERE t. taxno like concat ('%', CONCAT (?, '%') Order by t. id desc) a where rownum
Don't say it, first on the code.Pg:--Establishment of T1 tableCREATE TABLE Public. T1 (F1INTEGER not NULL, F2VARCHAR( -), F3VARCHAR( -)[][] [], CONSTRAINTT1_pkeyPRIMARY KEY(F1)) with(OIDs=false);--Create an array of T1 table behavior elements to
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.