Query records of % XX %
1. Use instrSelect count (*) from table t where instr (T. column, 'xx')> 0This query is very effective and fast
Query records of % xx
Select count (C. c_ply_no) as Count
From policy_data_all C,
This is often the case where some data is read using SQL and then processed based on the data. For example, if the student's student ID increases sequentially, the student ID is usually obtained and generated using the following method.
Select max (
Conditional loops can be implemented in two ways.1. For variable in start value... end value loop end loop;2. While condition loop end loop;
Loop usage:I. X: = 100;LoopX: = x + 10;If X> 1000 thenExit;End if end loop;Y: = X;Ii. X: = 100;LoopX: = x +
Baggio785http: // blog.csdn.net/baggio785column Selection
When PLSQL is used to perform data queries, the from clause is required, which is the same as that of SQL Server. The SELECT statement must select the target data table. There is a special
Because the previous server end
CodeThese are all stored procedures used (Oracle or MSSQLServer ). Now we are working on supporting desktop applications (ACCESS ). Because the table structure is the same, you just want to take the previous Code and
In the query module of the latest project, the query condition uses the year, month, and day drop-down boxes. By default, data must be filled in the drop-down boxes, which are year, month, and day, and cascade requirements must be met. In this case,
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> Create Or Replace Trigger Trig_cas_stuBefore Insert Or Update Or Delete On Xsjwxxl For Each row
This articleArticleIt mainly analyzes the methods in which four databases (sqlserver/Oracle/MySQL/Sybase) query the first n data records or query the intermediate N data records. Perform a simple analysis on the syntax of the four databases.
First PasteCode, You have time to sort it out.
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Select
W_name,
Max
(Decode (UT. attdate, to_date (
'
2010-12-01
'
,
'
Yyyy-mm-dd
'
1.Use% Type In many cases,PL/SQLVariables can be used to store data in database tables. In this case, the variable should have the same type as the table column. For example,StudentsTableFirst_nameThe column type isVarchar2 (20 ),We can declare a
In Oracle, sequence is the sequence number, which is automatically increased each time it is obtained. Sequence has no relationship with the table.
1. Create Sequence First, you must have the create sequence or create any sequence permission.
The
ArticleDirectory
2. Usage of case when in different positions in the statement
1. The case when expression has two forms:
-- Simple case Functions Case Sex When ' 1 ' Then ' Male ' When ' 2 ' Then '
The main function of sys_connect_by_path is to distinguish all child nodes under a parent node by a specific character, and then connect them to a column for display.
Select Level , Sys_connect_by_path ( ID , '/' ) From Test Start With PID = 1
In the write and storage process, you sometimes need to return the cause of the error to facilitate viewing records.
Oracle provides the following exceptions:
1. pre-defined exception: used to handle common Oracle errors.
2. Non-pre-defined
Show parameter Processes; -- display the processing parameters definedSelect count (*) from V $ process; -- view the number of processed items currently in use
Alter system set processes = 5000 scope = spfile; -- modify the number of system
1. view the size of all tablespaces SQL> select tablespace_name, sum (bytes)/1024/1024 from dba_data_files 2 group by tablespace_name; 2. Used tablespace size SQL> select tablespace_name, sum (bytes)/1024/1024 from dba_free_space 2 group
1. Date interval operation
Current Time minus 7 minutes
Select sysdate, sysdate-interval '7' minute from dual
Current Time minus 7 hours
Select sysdate-interval '7' hour from dual
Current Time minus 7 days
Select sysdate-interval '7' day from
How.. Net executes Multiple SQL statements at a time. Generally, only one SQL statement can be executed at a time unless a stored procedure is used. For example, the following services are available: when deleting a user (assuming userid = 5), you
//////////////////////////////////////// // Some Oracle stored procedures
Create or replace package pack_page is
Type type_cur is ref cursor; -- defines the cursor variable used to return the record setProcedure proc_page(Pindex in number, --
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->-- Payment type
Select a. meaning,
A. description
From fnd_lookup_values
Where a. lookup_type = 'cux _ ydzjjh_lb'
And a. language = USERENV ('lang ')
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