oracleµÄһЩ֪ʶС½á
SqlÖÐÁ½¸ö“-”±íʾעÊ͵ĿªÊ¼¡£
Æ´½ÓÔËËã·û£º”||”,×¢Ò⣺ֻÓÐÔÚËùÓеÄÔËËã·ûΪnullʱ£¬Æ´½ÓµÄ½á¹ûÊÇnull¡£
±È½ÏÔËËã·ûÓÃÓڱȽÏÁ½¸öÖµ»ò±í´ïʽ£¬¸ø³öÒ»¸ö²¼¶ûÐ͵Ľá¹û true,false,null.
±È½ÏÔËËã·û£º
=
!= <> ^=
[not]in °üº¬
Any some ½«Ò»¸öÖµÓëÁбíÖеÄÿ¸öÖµ»òÕßÓë²éѯ½á¹ûÖеÄÿһ¸öÖµ½øÐбȽϣ¬¼ÙÈç²éѯûÓзµ»Ø½á¹û£¬Ôò½á¹ûΪfalse¡£Ç°Ãæ±ØÐëÓÐ=,!=,>=,<µÈ·ûºÅ¡£
Select last_name from emp where salary<=any(select salary from emp where deptno=10);
All ½«Ò»¸öÖµÓëÁбíÖеÄÿ¸öÖµ»òÕßÓë²éѯ½á¹ûÖеÄÿ¸öÖµ½øÐбȽϣ¬¼ÙÈç²éѯûÓзµ»Ø½á¹û£¬Ôò½á¹ûΪtrue¡£Ç°Ãæ±ØÐëÓÐ=,!=,<,>µÈ·ûºÅ¡£
Select last_name from emp where salary<=all(500,1000.9000);
[not] between a and b
Select last_name from emp where salary between 4000 and 10000;
[not] exists ¼ÙÈçÒ»¸ö×Ó²éѯÖÁÉÙ·µ»ØÒ»ÐÐʱ£¬½á¹ûΪtrue
Select last_name from emp a where not exists(select ‘x’ dummu from emp b where b.deptno=10 and a.last_name=b.last_name);
A [not] like b [escape ‘char’] ÓÃÓÚģʽƥÅ䣻¼ÙÈçģʽaÓëģʽbÆ¥Å䣬Ôò½á¹ûΪtrue¡£Ä£Ê½Æ¥Åä·û%ÓÃÓÚÆ¥Åä0¸ö»òÈÎÒâ¶à¸ö×Ö·û¡£_ÓÃÓÚÆ¥ÅäÒ»¸ö×Ö·û¡£¹Ø¼ü×ÖescapeÓÃÓÚÌáʾoracle½âÊÍ%ºÍ_×Ö·û£¬²»Òª½«ËûÃÇ×÷ΪÌØÊâ×Ö·û´®´¦Àí¡£
Select last_name from emp where last_name not like ‘Th%’;
Select last_name from emp where last_name like ‘_tt%’;
Select synonym_name from dba_synonums wnere synonym_name like ‘all\_u%’escape’\’;
Is [not] null Ö»ÓÐÒ»¸öÔËËã·û£¬ÓÃÀ´²âÊÔÆäÖµÊÇ·ñΪ¿Õ¡£
Select last_name from emp where salary is not null;
Âß¼ÔËËã·û£º
Not ½«½á¹ûÈ¡·´¡£¼ÙÈçÔËËãÊýÊÇnull£¬Ôò·µ»Ønull£¬µ±ÔËËãÊýÊÇfalseʱ£¬½á¹û·µ»Øtrue£¬·ñÔò·µ»Øfalse¡£
Select * from emp where not (salary<100)
And ¼ÙÈçËùÓеÄÔËËãÊýΪtrue£¬Ôò½á¹ûΪtrue£»Èç¹ûÆäÖÐÒ»¸öΪfalse£¬Ôò½á¹ûΪfalse¡£·ñÔò½á¹ûÊÇnull¡£
Or¼ÙÈçËùÓеÄÔËËãÊýΪfalse£¬Ôò½á¹ûΪfalse£»Èç¹ûÆäÖÐÒ»¸öΪtrue£¬Ôò½á¹ûΪtrue¡£·ñÔò½á¹ûÊÇnull¡£
¼¯ºÏÔËËã·û£º
Union ·µ»ØËùÓвéѯ½á¹ûÖеÄÐУ¬²»°üÀ¨Öظ´µÄÖµ
Ïà¹ØÎĵµ£º
When queried, virtual columns appear to be normal table columns, but
their values are derived rather than being stored on disc. The syntax
for defining a virtual column is listed below.
column_name [datatype] [GENERATED ALWAYS] AS (expression) [VIRTUAL]
If the datatype is omitted, it is determin ......
package com.chinacache.boss.queryservice.service.impl;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.chinacache.boss.queryservice.excepti ......
TO_DATE¸ñʽ(ÒÔʱ¼ä:2007-11-02 13:45:25ΪÀý)
Year:
yy two digits Á½Î»Äê ......
ËäÈ»ÎÒÃÇÖªµÀÉ̵À¹îÒ²,ÕâƪÎÄÕ»¹ÊÇÄܹ»ÈÃÎÒÃÇ´ÓijЩ½Ç¶ÈÉϹ۲졣±ÈÈçÅ·ÃËÓµ»¤¿ª·Å¼¼Êõ,Å·ÃËÒªÆÀ¼ÛOracleÓµÓÐMySQLºÍJavaËùÔì³ÉµÄÓ°Ïì,everything is politicalÒÑÈ»ÊÇÒ»Ìõ´ó·¹æÔòÁË£¬ÎÒÃÇ»¹ÊÇÄܹ»Ðá³öÕâ¸ö»Ï×ÓÏÂÃæÂôµÃ»¹ÊÇÀûÒæ¹Ï·ÖµÄÀϾÀ¸ð£¬×ܲ»ÄÜɶºÃʶ¼ÈÃÄãÃÀ¹úÀÐÕ¼ÁË¡£µ«ÊÇÎÒÏëÒ²Ö»ÊǸöʱ¼äÎÊÌ⣬ҲÐí±³ºóÍÆÊÖÒ ......
ÎÒÃǵÄOracle¹ÜÀí¹¤×÷Öо³£Éæ¼°µ½¸ü¸ÄOracleÓû§ÊôÐÔ¡¢ÃÜÂëÖ®ÀàµÄ³£ÓòÙ×÷£»µ«ÔÚijЩӦÓó¡¾°Ï£¬»áÓöµ½OracleÓû§Ãû¸ü¸ÄµÄÐèÇó£¬ÈçºÎ½â¾ö£¿ÏÂÃæͨ¹ýËĸö²½ÖèʵÏÖOracleÓû§ÃûµÄÐ޸ġ£
Ò»¡¢²éѯ¸ü¸ÄOracleÓû§Ãû
SQL> select user#,name,password from user$ where name ='TICKET ......