SQL °´×é±ð¹ýÂËÖ¸¶¨Ìõ¼þµÄÊ×ÐмǼ
Ô´Ìù£ºhttp://topic.csdn.net/u/20100417/19/ebdc216a-acc9-4e04-80f3-dbada0b4f3fe.html?74846
Êý¾ÝÀàÐÍ£º
Code char(6)
CreateTime datetime
Price float
Status bit
Êý¾ÝÈçÏ£º
Code CreateTime Price Status
031002 2008-10-17 15:00:15 3.58 1
031002 2008-10-17 15:00:16 5.53 1
031002 2008-10-17 15:00:17 4.54 1
031002 2008-10-17 15:00:18 4.44 1
031002 2008-10-17 15:00:19 4.34 1
031002 2008-10-17 15:00:20 4.24 1
031012 2008-10-17 15:00:15 3.58 0
031012 2008-10-17 15:00:16 5.53 0
031012 2008-10-17 15:00:17 4.54 0
031012 2008-10-17 15:00:18 4.44 0
031012 2008-10-17 15:00:19 4.34 1
031012 2008-10-17 15:00:20 4.24 1
031012 2008-10-17 15:00:18 3.51 0
031012 2008-10-17 15:00:19 3.52 0
031012 2008-10-17 15:00:20 2.50 0
031012 2008-10-17 15:00:21 3.51 0
031012 2008-10-17 15:00:22 3.52 0
031012 2008-10-17 15:00:23 2.50 0
031012 2008-10-17 15:00:24 3.51 0
031012 2008-10-17 15:00:25 3.52 0
031012 2008-10-17 15:00:26 2.50 0
031033 2008-10-17 15:00:21 4.53 0
031033 2008-10-17 15:00:22 3.55 0
031033 2008-10-17 15:00:23 3.55 0
031033 2008-10-17 15:00:24 5.57 0
031033 2008-10-17 15:00:25 5.57 1
031033 2008-10-17 15:00:26 5.57 1
031033 2008-10-17 15:00:27 5.57 1
031033 2008-10-17 15:00:28 5.57 1
ÎÒÏëÒªµÄ½á¹ûÊÇ
031012 2008-10-17 15:00:19 4.34 1
031033 2008-10-17 15:00:25 5.57 1
µÃ³öÕâ¸ö½á¹ûµÄÒªÇóÊÇ: °´ÕÕCode·Ö×飬°´ÕÕʱ¼äascÅÅÐò Status
Ïà¹ØÎĵµ£º
¡¾SQL¡¿ÐÐÁÐת»»
http://space.itpub.net/519536/viewspace-609167
Ò»¡¢ÁбäÐÐ
1.´´½¨²âÊÔ±ítest£¬²¢³õʼ»¯ÊµÑéÊý¾Ý
sec@ora10g> create table test (name_id varchar2(10), name varchar2(10));
sec@ora10g> insert into test values ('01','Andy1');
sec@ora10g> insert into test values ('01','Andy2'); ......
Ò», °²×° unixODBC
ÏÂÔØ°²×°°ü. ÔÚ RedHat °²×°¹âÅÌÉϾÍÓÐ
unixODBC-2.2.11-1.RHEL4.1.i386.rpm
unixODBC-devel-2.2.11-1.RHEL4.1.i386.rpm
unixODBC-kde-2.2.11-1.RHEL4.1.i386.rpm
°²×°
rpm -Uvh unixODBC-2.2.11-1.RHEL4.1.i386.rpm
rpm -Uvh unixODBC-devel-2.2.11-1.RHEL4.1.i386.rpm
Èç¹û°²×°ÖÐÌáʾÓÐ¶ÔÆäË ......
dim conn,connstr
Set conn = Server.CreateObject("ADODB.Connection")'´´½¨Ò»¸öÊý¾Ý¿âÁ´½Ó¶ÔÏóconn£¬·½±ãºóÃæµ÷ÓÃ
connstr="Provider=SQLOLEDB;Data Source=(local);Initial Catalog=111;User ID=sa;Password=1234;" '´´½¨Ò»¸öÊý¾Ý¿âµÄrecordset¶ÔÏ󣬷½±ãÒÔºóµ÷ÓÃ
conn.Open connstr'´ò¿ªÊý¾Ý¿â ......
¶ÔÕâ¸ö½øÐÐÓÅ»¯
select n5001 Ãŵê,n5002 ²¿ÃÅ,n5004 С·ÖÀà,n5019 ÉÌÆ·±àÂë,c01d21 ÉÌÆ·Ãû³Æ,
nvl(xse,0)-nvl(dzxs,0) ÏúÊÛ,
mle ëÀû,
nvl(xl,0)-nvl(dzsl,0) ÏúÁ¿
from
(select n5001,n5002,n5004,n5019,sum(n5011) xse,sum(n5016) mle,sum(n5023) xl
from n50
where to_char(n5010,'yyyymmdd')>='20 ......
order by µÄÊýÖµÐÍÁé»îʹÓÃ
select * from table_a where id=p_id order by decode(º¯Êý,'asc',1,'desc',-1)*jsny;
¿ØÖÆÊÔͼµÄ·ÃÎÊʱ¼ä£º
6.create view ...
as
select ... from where exists(select x from dual where sysdate>=8:00am and sysdate<=5:00pm)
ÃîÓÃdecodeʵÏÖÅÅÐò
select * from tabnam ......