Oracle spatial Query SQL query all the elements of a certain distance from a certain point (that is, the general query) SQL: www.2cto.com select t. objectid, t. comp_type, t. datatype, t. comp_name, t. health_lic, t. shape. SDO_PO
The previous article introduced PHP using DAO (Database Access object interface) to access the database, using DAO requires programmers to write SQL statements, for some complex SQL statements, Yii provides query Builder to help programmers generate SQL statements,
Oracle merge query transaction SQL function knowledge learning. For more information, see
Oracle merge query transaction SQL function knowledge learning. For more information, see
Table que
SQL connection query for Oracle databasesPrefaceIn reality, there is such a requirement that sometimes the data we need to query is in multiple tables, so how to query data from multiple tablesWhat about it? In this case, you need to use table connections to perform queries.
☆Retrieve all table names and column names of the databaseSelect name from sysobjects where xtype = 'U'Select name from syscolumns where id = (select max (id) from sysobjects where xtype = 'U' and name = 'table name ')☆Recursive Data QueryRecursive query of SqlServer2005 and Oracle in SQL statementsI used Oracle before
The best way to learn is practice! Therefore, my learning is based on practice. The most basic SQL statement is the query statement.
The best way to learn is practice! Therefore, my learning is based on practice. The most basic SQL statement is the query statement.
Preface
The best way to learn is practice! Theref
Different databases: oracle mysql SQL Server DB2 infomix sybase paging query statement, infomixsybase
Paging query statements used in different databases:
Current page: currentpagePage size: pagesize
1. Oracle Database
Select * from (select A. *, rownum rn from (QUERY_
Oracle SQL classical query expert Article 4
Oracle SQL classical query expert Article 4
This article is the fourth article on typical query of OracleSQL. It is just the author's own opi
One: The value of the field of the query string type is NOT NULL for SQL:[SQL]View Plaincopy
SELECT * from tb_cms_flgtinfo_a t where (T.fsta are not null and t.fsta ');
Main: The above tb_cms_flgtinfo_a is the table name, Fsta is the field in the tableTwo: The query string Type field has a null value f
BackgroundWhen using Oracle or other databases, using the LIKE keyword for fuzzy query is commonly used by people, in the use of pure Chinese environment is very easy to use, there are some wildcards can be used, but in a pure English environment, the size of the need to accurately match the problem, the main reason is the problem of string
FL like '%{0}% ' and
Here like after is a string, so
ORACLE basic SQL statements-query, oraclesql statements
1. Common Query
/* Query table data */Select * from STU
/* Retrieve the first three rows of Data */Select * from stu where ROWNUM
/* Fuzzy query */Select * from stu where s
Oracle multi-Table query, as its name implies, queries the data you want from multiple tables. Here we will test the emp table and dept table under the scott user. The structure of the two tables is as follows:SQL> select * from dept;DEPTNO DNAME LOC-------------------------------------10 ACCOUNTING NEW YORK20 RESEARCH DALLAS30 SALES CHICAGO40 OPERATIONS BOSTON
SQL
Query all the elements of a distance from a certain point (that is, the surrounding query) SQL:
Select T. objectid, T. comp_type, T. datatype, T. comp_name, T. health_lic, T. shape. sdo_point.x as x, t. shape. sdo_point.y as Y, T. reg_addr, T. bus_addr from t_publicplaces t where 1 = 1 and substr (T. comp_type,) = '01' and sdo_within_distance (T. shape, sdo_geom
">
2. Merge into statement:
For the top statement, you can use the merge into statement
--Merge into implementation method
merge into EMP
using (SELECT * from
emp_new1
) E on
(e.empno = emp.empno)
when matched then
update set emp.empdesc = E.empdesc;The execution results are the same as the results in 1, assuming inference. It is recommended to use the merge into method.
Because merge into only visits once emp_new1.
Iii. Deleting delete op
This article provides a detailed analysis of the implementation of Oracle SQL statements for querying and deleting jobs, for more information about how to query and delete duplicate records, see SQL statement 1. For more information about duplicate records in a table, see select * frompeoplewherepeopleIdin (selectpeopl
Oracle Query result set, random sort
Copy Code code as follows:
SELECT * FROM table1 ORDER by Dbms_random.value ();
MySQL randomly query out a record:
Copy Code code as follows:
--The following query statement is efficient, do not use SELECT * FROM table1 to rand () LIMIT to
One of the Oracle-SQL skills (query continuous records) Requirement Description: www.2cto.com needs to query that a customer has been continuously performing business for those days of a year. The SQL implementation is as follows: Create a table: create table test_num (tyear
Tags: data SP problem BS database server SQL as installationWhen SQL Server accesses a database table in Oracle remotely:The remote syntax is typically: SELECT * from OpenQuery (Oracle linked server name, ' query statement ')Eg:select * from OPENQUERY (QTX, ' select * from s
The paging query method for Oracle, SQL, and DB2 is different from that for paging query statements in Oracle and SQL, the following describes the differences between DB2 paging query a
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.