Common Oracle functions: nvl/nullif/case when/wm_concat/replace 1. nvl function nvl converts a null value to an actual value. The data type can be date, number, character, and data type must match: nvl (commision, 0) nvl (hiredate, '01-JAN-87 ') nvl (job_id, 'no manager') nvl (to_char (job_id), 'no manager') nvl can convert any data type, however, the returned value of the converted data type must be of the expr type of the first parameter nvl (expr1, expr2. example: date, number, varchar2 or ch
From: http://www.lemongtree.com/2006/11/28/0000572.aspxA friend on csdn asked this question and wrote it later.
Why do we need to customize it?First, customization is more flexible and does not rely too much on the aspnetdb database, which facilitates your own expansion. Second, you can still use the login control in. NET 2.0 after customization.Of course, custom is not customized at will, but two abstract classes are implemented:Membershipprovider and roleproviderFor more information about th
ADO. An overview of the 5 large objects in net :1---Connection object : Connect to the database.(1) Log in with SAconn = new SqlConnection ("Data source=newland-pc;initial catalog=srr1100u; User id=sa;pwd=123456; " ); Conn. Open (); (2) using Windows Local Login New SqlConnection ("Data source=newland-pc;initial catalog=image;integrated security=true;" 2---Command object : Executes the T-SQL statement.(1) ExecuteNonQuery () method, perform additions and deletions to change the command.
compare to the relationship value and instead to the exist () with Sql:column ().Http://msdn.microsoft.com/zh-cn/library/ms178030.aspxImplemented using the XML value method (not recommended)
Copy Code code as follows:
DataTable dt = new DataTable ();
using (SqlConnection conn = new SqlConnection (connectionString))
{
string xml = @ "
SqlCommand COMM = conn. CreateCommand ();
Using the value method is not recommended, and performance
column Name 1, column name 2,..., column name n from table name;Exercise: Select Empno,ename,sal,comm,deptno from EMP;3.3 Queries show the Dept Department: Department number, department name, areaSelect Deptno,dname,loc from dept; --"Summary" FROM clause-------------------------------------------------------------------------------------Query all fields of a table: field names are available * instead. Select Column Name 1, column Name 2, ..., column
I. SQL trigger sending
Ii. Send the winform program with the task plan
Page
// ReferenceUsing System. Data. Common;Using System. Data. SqlClient;Using System. Configuration;Using System. Data;Using System. Net. Mail;
// The email to be sentPublic static DataSet SendEmailList (){DataSet ds = new DataSet ();Try{String str = ConfigurationSettings. etettings ["ConnectionString"];SqlConnection conn = new SqlConnection (str );Conn. Open ();SqlCommand comm
connectionSqlconnection conn = new sqlconnection (sqlconnstring );Try{Conn. open ();}Catch (exception E){// Record the cause if the connection failsEventLog. writeentry (E. Message );Return;}// Start the transactionSqltransaction TRAN = conn. begintransaction ();Sqlcommand comm = new sqlcommand ();
Comm. Transaction = Tran;Comm. Connection = conn;Try{// Obtain t
Oracle analysis function PERCENTILE_CONT
Query the salaries of people with the salary distribution of 25%, 50%, and 75% in each department. percent_rank () is the relative position in the ranking.
Create table EMP (empno number (4) not null, ENAME VARCHAR2 (10), JOB VARCHAR2 (9), mgr number (4), hiredate date, sal number (7, 2 ), comm number (7369), deptno number (2); insert into emp (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL,
Oracle Advanced query over (partitionby ..)
To facilitate learning and testing, all examples are created under Scott, an Oracle user.
create table EMP( empno NUMBER(4) not null, ename VARCHAR2(10), job VARCHAR2(9), mgr NUMBER(4), hiredate DATE, sal NUMBER(7,2), comm NUMBER(7,2), deptno NUMBER(2))alter table EMP add constraint PK_EMP primary key (EMPNO);insert into EMP (empno, ename, job, mgr, hiredate, sal,
Oracle analysis function PERCENTILE_CONT, percentile Function
Query the salaries of people with the salary distribution of 25%, 50%, and 75% in each department. percent_rank () is the relative position in the ranking.
Create table EMP(Empno number (4) not null,ENAME VARCHAR2 (10 ),JOB VARCHAR2 (9 ),Mgr number (4 ),Hiredate date,Sal number (7,2 ),Comm number (7, 2 ),Deptno number (2));Insert into emp (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL,
Oracle Advanced query over (partition by...), advanced query ..
To facilitate learning and testing, all examples are created under Scott, an Oracle user.
create table EMP( empno NUMBER(4) not null, ename VARCHAR2(10), job VARCHAR2(9), mgr NUMBER(4), hiredate DATE, sal NUMBER(7,2), comm NUMBER(7,2), deptno NUMBER(2))alter table EMP add constraint PK_EMP primary key (EMPNO);insert into EMP (empno, ename, job, mgr, hiredate, sal,
necessary for our development, if we have no special needs. Let's say you've installed SQL Server, 2005 or 2008, and if you don't know how to install SQL Server, I recommend bing.com SQL Server 2005 installation diagram.So, the database is installed, the first thing is to create a database to connect it? OK, take a look at our example:Four: VideoNon-public section, please contact the best course (www.zuikc.com)Five: Create a sample databaseThe next step is to create our sample database, which w
employee is in. You can have a searched case statement can have many different when clauses, and so you can apply many the criteria in T Hose clauses to get the answers for you need.
Nullif and COALESCETo further comply with SQL 1999, the NULLIF and coalesce statements have been to added. The NULLIF statement is very simple. It takes two arguments. If they are equivalent, then the result is a NULL. If They are not equivalent, then the ' the ' the ' the ' the ' is ' argument by the function. Thi
Tags: Oracle overIn order to facilitate learning and testing, all examples are created under the Oracle's own user Scott.CREATE TABLE EMP ( empno number (4) Not null, ename NBSP;VARCHAR2 (Ten), job NB Sp NBSP;VARCHAR2 (9), Mgr number (4), hiredate date, sal number ( 7,2), Comm Number (7,2), deptno Number (2)) ALTER TABLE emp add constraint pk_emp Prim ary Key (EMPNO); insert into EMP (EMPNO, ename, Job, Mgr, HireDate, Sal,
digital format: century, year, month, day, hour, minute, second
The default date format is DD-MON-YY. You can use the sysdata function to obtain the current system date and time.
Calculation: The date type data can be directly added or subtracted by a number, and the result is that the date. The agreed value indicates the number of days of addition and subtraction.
The two date data types can be subtracted, and the result is how many days the two data types differ. No, because the addition of d
agreed value indicates the number of days of addition and subtraction.
The two date data types can be subtracted, and the result is how many days the two data types differ. No, because the addition of dates is meaningless.
NVL () function
Overview: it is used to replace null with the specified default value, applicable to character, number, date, and other types of data
Format: NVL (exp1, exp2) -- if the expression exp1 value is null, The exp2 value is returned; otherwise, the exp1 value is ret
exp2 value is returned; otherwise, the exp1 value is returned.Example: Select empno, ename, Sal, comm, Sal + nvl (Comm, 0) from EMP;Select empno, ename, job, nvl (job, 'no job yun') from EMP;
Nvl2 () functionOverview: it is used to implement the conditional expression function.Format: nvl2 (exp1, exp2, exp3) -- if the expression exp1 value is not null, The exp2 value is returned; otherwise, the exp3 val
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.