sqlserverÒÆֲΪOracle±Ê¼Ç
Oracle±Ê¼Ç
l ¹ØÓÚTRUNCº¯Êý
SELECT
RELATED_ID ,
DOC_ID ,
CAT_ID ,
CAT_CODE ,
RELEASE_DATE ,
RELEASE_MAN
from TB_DOC_MODCONTENT A WHERE
(RELEASE_DATE>=trunc(cast('2009-8-28 21:26:16' as date),'DD') AND RELEASE_DATE<trunc(cast('2009-8-28 21:26:16' as date)+1,'DD'))
¹ØÓÚTRUNCº¯ÊýµÄformat,×Ô¼ºÏÖÔÚÓеãÌå»á,formatΪdayʱ,Ö»¾«È·µ½Ìì,¶ø²»¹Ü¼¸Ä꼸ÔÂÖ»ÒªÊÇ·ûºÏµÄday¾Í¿ÉÒÔÁË,ÒªÏëÈ·¶¨Ò»ÄêÖеÄijÔµÄijһÌì¾ÍÒªÓÃtrunc(date,''dd'').
ͨË×µÄ˵°É,formatΪÄêʱ,¾«È·µ½-----Äê
ΪÔÂʱ,¾«È·µ½------Äê,ÔÂ(²»¹ÜÄÄÄê,Ö»ÒªÊÇÏàͬµÄÔºÍÄÄÌì)
ΪÈÕʱ,¾«È·µ½------Äê,ÔÂ,ÈÕ(²»¹ÜÄÄÄêµÄÄÄÔÂ,Ö»¹ØÐÄÊÇÄÄÌì)
1.TRUNC(for dates)
TRUNCº¯ÊýΪָ¶¨ÔªËضø½ØÈ¥µÄÈÕÆÚÖµ¡£
Æä¾ßÌåµÄÓï·¨¸ñʽÈçÏ£º
TRUNC£¨date[,fmt]£©
ÆäÖУº
date Ò»¸öÈÕÆÚÖµ
fmt ÈÕÆÚ¸ñʽ£¬¸ÃÈÕÆÚ½«ÓÉÖ¸¶¨µÄÔªËظñʽËù½ØÈ¥¡£ºöÂÔËüÔòÓÉ×î½üµÄÈÕÆÚ½ØÈ¥
ÏÂÃæÊǸú¯ÊýµÄʹÓÃÇé¿ö£º
TRUNC£¨TO_DATE(’24-Nov-1999 08:00 pm’,’dd-mon-yyyy hh:mi am’)£©
=’24-Nov-1999 12:00:00 am’
TRUNC£¨TO_DATE(’24-Nov-1999 08:37 pm’,’dd-mon-yyyy hh:mi am’,’hh’)£© =’24-Nov-1999 08:00:00 am’
round (date,''format'')δָ¶¨formatʱ£¬Èç¹ûÈÕÆÚÖеÄʱ¼äÔÚÖÐÎç֮ǰ£¬Ôò½«ÈÕÆÚÖеÄʱ¼ä½Ø¶ÏΪ12 A.M.(ÎçÒ¹,Ò»ÌìµÄ¿ªÊ¼),·ñÔò½øµ½µÚ¶þÌì¡£
TRUNC(date,''format'')δָ¶¨formatʱ£¬½«ÈÕÆÚ½ØΪ12 A.M.£¬²»¿¼ÂÇÊÇ·ñÔÚÖÐÎç֮ǰµÄÌõ¼þ¡£
2.TRUNC(for number)
TRUNCº¯Êý·µ»Ø´¦ÀíºóµÄÊýÖµ£¬Æ乤×÷»úÖÆÓëROUNDº¯Êý¼«ÎªÀàËÆ£¬Ö»ÊǸú¯Êý²»¶ÔÖ¸¶¨Ð¡ÊýÇ°»òºóµÄ²¿·Ö×öÏàÓ¦ÉáÈëÑ¡Ôñ´¦Àí£¬¶øͳͳ½ØÈ¥¡£
Æä¾ßÌåµÄÓï·¨¸ñʽÈçÏÂ
TRUNC£¨number[,decimals]£©
ÆäÖУº
number ´ý×ö½ØÈ¡´¦ÀíµÄÊýÖµ
decimals Ö¸Ã÷Ðè±£ÁôСÊýµãºóÃæµÄλÊý¡£¿ÉÑ¡ÏºöÂÔËüÔò½ØÈ¥ËùÓеÄСÊý²¿·Ö
ÏÂÃæÊǸú¯ÊýµÄʹÓÃÇé¿ö£º
TRUNC£¨89.985£¬2£©=89.98
TRUNC£¨89.985£©=89
TRUNC£¨8
Ïà¹ØÎĵµ£º
SQL*PLus> desc emp;
Ãû³Æ &nbs ......
1¡¢ÔÚoracleµÄsys-sysdbaϵǽ
дһ¸öjava source³ÌÐòÁ´½Ósqlserver2005£º
create or replace and compile java source named test as
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class excutesql1
{
public static String entry ......
ÉùÃ÷£º
ÒÔϵÄÀý×Ó²»Ò»¶¨ÕýÈ·£¬Ö»ÊÇΪÁËÑÝʾ´ó¸ÅµÄÁ÷³Ì¡£
Ò»£ºÎÞ·µ»ØÖµµÄ´æ´¢¹ý³Ì
´æ´¢¹ý³ÌΪ£º
CREATE OR REPLACE PROCEDURE TESTA(PARA1 IN VARCHAR2,PARA2 IN VARCHAR2) AS
BEGIN
INSERT INTO HYQ.B_ID (I_ID,I_NAME) VALUES (PARA1, PARA2);
END TESTA;
È»ºóÄØ£¬ÔÚjavaÀïµ÷ÓÃʱ¾ÍÓÃÏÂÃæµÄ´ ......
MySQL Data Type
Oracle Data Type
BIGINT
NUMBER(19, 0)
BIT
RAW
BLOB
BLOB, RAW
CHAR
CHAR
DATE
DATE
DATETIME
DATE
DECIMAL
FLOAT (24)
DOUBLE
FLOAT (24)
DOUBLE PRECISION
FLOAT (24)
ENUM
VARCHAR2
FLOAT
FLOAT
INT
NUMBER(10, 0)
INTEGER
NUMBER(10, 0)
LONGBLOB
BLOB, RAW
LONGTEX ......
¡¾51CTO.com¶À¼ÒÌظ塿Ãæ¶Ô¾ª»ÅµÄ¿Í»§ºÍ¹ã·ºÖÊÒɵÄýÌ壬Oracle¹Ù·½×î½üÖÕÓÚ³ö°ñ°²Ãñ£¬ÄDZãÊÇÒ»¸öÒÔ“SUN CUSTOMERS ,Oracle Plans To£º”Ϊ´ó±êÌâµÄ¹ã¸æ¡£Ö±Òë¹ýÀ´±ã¹ýÀ´¿ÉÖªµÀ£¬Oracle½«Òª¼Ó´óSPARCºÍSolarisµÄͶÈëÁË£¬¶ø´óÀÏ°å°£ÀïÉÒ²ÏòIBMÓ²¼þÏÂÁËÕ½Ê飬Éù³ÆOracle½«×îÖÕÓ®µÃÕⳡ¾ºÕù……
&n ......