) from emp;5. SQL and SQL * PlusYou can use SQL * Plus:Describes the table structure, edits SQL statements, and executes SQL statements. Save the SQL statement in the file and save the SQL statement execution result in the file. Execute the statement in the saved file. Load the text file into the SQL * Plus editing window.6 Other comparison operationsUse the LIKE operation to select a similar value;The selection condition can contain characters or numbers: % Represents zero or multiple character
of rows selected is displayed.14. set feedback on; displays the number of rows selected during execution.15. set heading off; cancel the header information of the field16. set heading on; displays the header information of the field.17. set trimout on;18. set trimout off;Ii. query table:1. select * from tabs; query system table2. select table_name from user_tables; Name of the table under the current user3. desc table name query table structure4. set linesize 120 to set the Row Height5. col nam
characters (any character); _ represents one character; '%' and '-' can be used at the same time; you can use the ESCAPE identifiers to select the '%' and '_' symbols. To avoid special symbols, use ESCAPE characters. For example, convert [%] to [\ %], [_] to [\ _], and then add [ESCAPE '\']. Use IS (NOT) NULL determines the NULL value.
Example:
Select * from emp where sal between 1000 and 2000; empno ename job mgr hiredate sal comm deptno ----------
special characters are used in the alias or the output is case-insensitive.
Format: SELECT
|
[[AS]
],... FROM
;
Example: select empno, ename "Ename", sal * 12 "annual salary" from emp;
Select empno as employee ID, ename employee name, sal * 12 "annual salary" from emp;
Note: as can be skipped. Aliases can be enclosed in double quotation marks. If the alias does not contain special characters, double quotation marks can be omitted.
If the alias conta
(commonly used) is returned)For example, if an employee has no commission, 0 is displayed; otherwise, the Commission is displayed.Select comm, nvl (comm, 0) from emp;Nullif (ex1, ex2 ):Returns NULL if the value is equal. Otherwise, the first value is returned.For example, if the salary is equal to the Commission, it is blank; otherwise, the salary is displayed.Select nullif (sal,
Using system;
Using system. runtime. interopservices;
Namespace nativedll
{/// /// Summary of SerialPort./// Public class SerialPort{# Region declares the APIS related to serial call to be referenced// Win32 API ConstantsPrivate const uint generic_read = 0x80000000;Private const uint generic_write = 0x40000000;Private const int open_existing = 3;Private const int invalid_handle_value =-1;Private const int maxblock = 4096;
Private const uint purge_txabort = 0x0001; // kill the pendin
=" 115 "/>
Important:
* The TO_NUMBER () function is not considered;
* The TO_CHAR () function is the focus;
* The TO_DATE () function is the secondary focus.
5-General functions (CORE)
There are two common functions: NVL) and DECODE (). These two functions are Oracle's own special functions;
1. NVL () function, processing null
Example 26:: Query the total annual salary of each employee.
SQL> SELECT ename, sal, comm, (sal +
Compare two files in linux, and compare two files in linux
Recently, I am writing a script to compare the configuration IP address of the/etc/dhcpd file with the IP address obtained by arp-n. This requires finding out the difference between the two output files-that is, there is no part in file 1 but in file 2, or there is a part in file 2 but not in file 1. There are four common methods on the Internet to implement this function. However, in actual tests, it is found that the results of one met
Java serial port communication API description Java serial port communication
Java serial communication API descriptionJava Serial CommunicationJava provides the communicationapi (included in the javax. Comm package) for controlling various external devices in a machine-independent manner. Communications API is an extension of standard Java, which is not included in Java API. Therefore, you must first download this extension class library fro
/html/[[email protected] html]# lsindex.htmlAt this point, according to normal situation, because there is a index.html page in the HTML directory, if we refresh the browser page, we should jump to the index.html pageBut the fact that we found that the page is still on this test page, exactly why? This is related to our selinux security strategy, we can go to /var/log/audit This directory to view audit.log This file, to find out the error message[[emailprotected] html]# tail/var/log/audit/audit.
1. General method of calling stored procedures
Let's assume that there is a stored procedure dt_users in SQL Server:
CREATE PROCEDURE [dbo]. [Dt_users]
As
SELECT * from Users
Return
Go
The first approach is to not use the command object, directly using the Recordset object
Set Rs=server.createobject ("Adodb.recordset")
Sql= "Exec dt_users"
Rs.Open sql,conn,1,1 so you can
The second approach is to take advantage of the Command object
Set Comm=server.cr
1. General method of calling stored procedures
Let's assume that there is a stored procedure dt_users in SQL Server:
CREATE PROCEDURE [dbo]. [Dt_users]
As
SELECT * from Users
Return
Go
The first approach is to not use the command object, directly using the Recordset object
Set Rs=server.createobject ("Adodb.recordset")
Sql= "Exec dt_users"
Rs.Open sql,conn,1,1 so you can
The second approach is to take advantage of the Command object
Set Comm=server.cr
execution is displayed as ename. Only double quotes are given to it to show the following significant lowercase
Null value
Overview: Null values are invalid, unspecified, unknown, or unpredictable values. Null value is not equal to 0 or space
For example: select Empno, ename, Sal, comm from emp;--the Comm properties of some records will show a blank, i.e. null value
INSERT into student (age) VALUES (24
Copy Code code as follows:
--Execution order from Where Select
SELECT * FROM
(select Sal as salary,comm as commission from EMP) x where salary--Draw Name Work as a Job
Select Ename + ' Work as a ' +job as msg from EMP where deptno=10
--If the employee pay less than 2000 returns underpaid greater than or equal to 4k return OK between overpaid
Select Ename,sal,
Case when salWhen sal>=4000 then ' overpaid '
Else
' OK '
End
From EMP
--Ran
Stored procedure 1. General method of calling stored procedures
Let's assume that there is a stored procedure dt_users in SQL Server:
CREATE PROCEDURE [dbo]. [Dt_users]
As
SELECT * from Users
Return
Go
The first approach is to not use the command object, directly using the Recordset object
Set Rs=server.createobject ("Adodb.recordset")
Sql= "Exec dt_users"
Rs.Open sql,conn,1,1 so you can
The second approach is to take advantage of the Command object
Set Comm
value itself is returned EX1 (common)Example: If an employee does not have a commission, 0 is displayed, otherwise the Commission is displayedSelect COMM,NVL (comm,0) from EMP;Nullif (EX1,EX2):value is equal to NULL, otherwise the first value is returnedExample: If wages and commissions are equal, the display is empty, otherwise the wages are displayedSelect Nullif (Sal,
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.