value Select min from EMP; Max: Max value Sum: Sum Count: Calculates the number of bars; note: null rows are not counted if the column name is written. Select Count(*) fromEmpwhereJob='MANAGER';--count the number of managers
Select sum(SAL) fromEmp--sum of statistical wages
Select Count(*) fromEmpwhereDeptno= -;--Statistics Department Number 30, how many people?
Select Count(distinctJob fromEmp--How many jobs are there, removing duplicate data Note: The results of the query can not be displa
MSSQL2008R2 Link ORACLE 11:To create a link:exec sp_addlinkedserver ' dblink_oracl ', ' ORACLE ', ' msdaora ', ' ORCL120 'Among them, ORACL120 for the local installation of the Oracle driver, after Tnsnames.ora configured the link string operation, and with sqlgate similar tool tested passed.ORACLE driver, I am a 32-bit system that can install the thin installati
oracle| Performance | optimization
46. Connect multiple Scans
If you compare a column to a limited set of values, the optimizer may perform multiple scans and concatenate the results.
Example:
SELECT *
From lodging
WHERE MANAGER in (' Bill GATES ', ' KEN MULLER ');
The optimizer may convert it to the following form
SELECT *
From lodging
WHERE MANAGER = ' BILL GATES '
or MANAGER = ' KEN MULLER ';
Tags: sort nls_sort nls_compIn SQL sorting, Oracle defaults to a binary ordering method. The case has different values, and the uppercase values are in front. Sometimes, we need to deal with situations where we want to sort by ignoring the casing. There are several ways to accomplish this:
Setting the NLS environment variableAlter session Set Nls_sort = ' binary_ci ';
Using the upper and lower
), SOUNDEX (Smythe)
O:select SOUNDEX (Smith), SOUNDEX (Smythe) from dual
Compare Soundex difference with Select difference (Smithers, smythers) in SQL Server
Return 0-4,4 to the homonym, 1 highest
Third, date function
37. System Time
Copy Code code as follows:
S:select getdate () value
O:select Sysdate value from dual
38. A few days before and afterAdd and subtract directly from integers
39. Request a Date
Copy Code
numberS:select rand () valueO:select Sys.dbms_random.value (0,1) value from dual;13. Take the symbolS:select sign ( -8) value-1O:select sign ( -8) value from Dual-1======= Mathematical Function =======14. PiS:select PI () value 3.1415926535897931O: I don't know15.sin,cos,tan parameters are measured in radiansExample: Select Sin (PI ()/2) value gets 1 (SQL Server)16.asin,acos,atan,atan2 return radians17. Radian Angle Interchange (sqlserver,
First, take a look at SQL Server, before we both select a start time and an end time (in the smallest unit of day) from the foreground user and then query as a condition, if directly through "between StartTime and Endtime" as a condition, Discovery will automatically convert "2009-06-17" to "2009-06-17 00:00:00", so the following query conditions "between ' 2009-06-16 ' and ' 2009-06-17 '", can only get the
Installing JAVA-JDKThis part of the tutorial is a lot, you can follow the online tutorial to installInstalling SqldeveloperDownload Sqldeveloper Linux RPM http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.htmlSince Oracle does not provide the. deb installation package, you need to download and install Alien, convert and install rpmsu
: select ID from t where substring (name,1,3) = ' abc '//Oracle The total is substr function. select ID from T where DATEDIFF (day,createdate, ' 2005-11-30 ') =0// Yes, I did. There is no DateDiff function. select ID from t where name like ' abc% ' BR style= "margin:0px;padding:0px;" >select ID from t where createdate>= ' 2005-11-30 ' and createdateoracle time should convert char to date such as: CreateDate
table scan using the index. Such as:Select ID from t where substring (name,1,3) = ' abc '//Oracle The total is substr function.Select ID from t where DATEDIFF (day,createdate, ' 2005-11-30 ') =0//checked out indeed there is no DateDiff function.should read:Select ID from t where name like ' abc% 'Select ID from t where createdate>= ' 2005-11-30 ' and createdateOracle time should convert char to date such a
First look at how SQL writesSelect * from ( Select A.*, ROWNUM rn from (lowest query statement ) A wherelt; = #{endcol} ) where gt; #{startcol}Note: Of course we also need select COUNT (*) the lowest query statement to get the total number of result sets. And then convert the Endcol and Startcol.The conversi
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.