1. nvl Function The nvl function converts a null value to an actual value. The data type can be date, number, character, and must match: for example:Nvl (commision, 0) Nvl (hiredate, '01-JAN-87 ') Nvl (job_id, 'no manager ') Nvl (to_char (job_id),
At 16:01:58, January 1, October 29, 2013, when the data has a time column, such as the call duration, it is inconvenient for us to query. we can add a redundant column to calculate the number of seconds, now, I want to change the time for example 00:
Bitwise operators
Bitwise operators perform bitwise operations between two expressions. These two expressions can be any two integer data types. Symbols of bitwise operators and their definitions are as follows:4.3.
Table4.3Bitwise operators
------------------------------------
-- Author: flystone
-- Version: v1.001
-- Date: 2008-08-01 12:39:33
------------------------------------
-- Test data: Ta
If object_id ('ta ') is not null
Drop table Ta
Go
Create Table TA (BNO int,
Insert into testtable (recordnumber, currentdate) values (I, sysdate );
Print '';
Select @ I = @ I + 1;
End;
After comparison, we can see that it is different.
The command structure in plsql isDelacreDefine statement segmentsBeginExecution
compared with the previous version, the field is slightly different. If the field is changed to a long character. The sample data file cannot be uploaded directly, so it is a compressed package file.
Alter function ufn_id () -- because the fields
Let's look at some examples:
Copy codeThe Code is as follows:-- Obtain the count information of a tableSelect count (*) from T with (nolock)
-- Obtain the count information of a specific valueSelect count (*) from T with (nolock)Where v = '--
Requirements: There is a user login log table, record the user every time, and then want to find the user by day continuous landing, find out the earliest time and the last time and consecutive landing days.
--=======================================
When ANSI_NULLS is on, following the standard of SQL92, only is null can be used to determine if the value is null, but not = or <> to be compared with NULL, any value including null value and null value do = or <> All operations get false.When ANSI_
Character handling functions The common character types in SQL are:char (n)--length fixed immutable non-Unicode character data n must be a numeric value between 1 and 8,000NCHAR (n)-the value of fixed, immutable Unicode character data n must be
In view of many colleagues in the group asked this question, I simply write a demo, hoping to help beginners!No truth, no commentary, no explanation, straight on code!--==================================================--sample code, for reference
Hashbytes is a higher-precision function than checksum, the usage reference checksum, hashbytes can only have one input parameter, and the data type of the parameter is varchar, nvarchar, or varbinary.The first part: The syntax of Hashbytes on MSDN
Insert into testtable (recordnumber, currentdate) values (I, sysdate );Print '';Select @ I = @ I + 1;End;After comparison, we can see that it is different.The command structure in plsql isDelacreDefine statement segmentsBeginExecution statement
Field Description Added:
Execute sp_addextendedproperty n 'Ms _ description', 'transfer id', N 'user', DBO, N 'table', bas_category_dat, N 'column', transid;Parameters 1, 3, 5, and 7 are fixed.
2nd parameters are described in detail
The first
Expected results: (I got a one-to-one relationship and compared it to another table) Select * From empoylee where (address1, address2) in (select address1, address2from empoyleeadresseswhere Country = 'Canada ') the preceding method cannot be used.
Create an empty table:SQL = "CREATE TABLE [Table name]"
Create a table with fields:SQL = "CREATE TABLE [Table name] ([field name 1] Memo not null, [field name 2] Memo, [field name 3] counter not null, [field name 4] datetime, [field name 5] Text (2
/* Table 1. employee table ): eid name department job email password 10001 Li Ming SBB eg 10003 Li Yiping Luke ITM 11045 Li Jie SBB eg 10044 Hu Fei MTD etn 10009 Xu zhonggang SBB eg 10023 Li Yan SBB etn 20460 Lu mingsheng MTD etn 20078 Zhang Qing
(To csdn) Original: http://topic.csdn.net/u/20071026/16/59d85356-ff06-44e9-8e01-e6e1869a8a30.html
-- Form 1: Create Table A (ID Int , Country Varchar ( 100 )) Insert A Select 1 , ' China; Japan; South Korea ' Union All Select
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.