需要多一層<s:iterator
範例:
<s:iterator value="#request['immaplist']" status="stat">
<s:iterator>
<s:property value="#stat.index"/>
<s:property value="key"/>
<s:property value="value"/>
</s:iterator>
</s:iterator>
<s:iterator value="#request['immaplist']" status="stat">
<s:iterator>
<s:property value="#stat.index"/>
<s:property value="key"/>
<s:property value="value"/>
</s:iterator>
</s:iterator>
<s:fielderror theme="myThem" cssClass="error-message" fieldName="email" />
<s:fielderror cssClass="error-message"><s:param>email</s:param> </s:fielderror>
<s:fielderror value="startYear.val" />
<s:if test="hasFieldErrors()"> 有錯誤訊息!!</s:if>
SELECT USER_TABLES.TABLE_NAME ,num_rows 列數 ,
SUM(BYTES) / (1024 * 1024) AS "size(M)"
FROM USER_TABLES,
USER_SEGMENTS WHERE USER_SEGMENTS.SEGMENT_NAME = USER_TABLES.TABLE_NAME
GROUP BY USER_TABLES.TABLE_NAME,num_rows
ORDER BY "size(M)" DESC
select substr(to_char(dbms_random.value),5,5)rnd from xx --只有數字
SELECT ABS(dbms_random.normal) from xx --只有數字
SELECT (1+ABS(MOD(dbms_random.random,100000))) from xx --只有數字
SELECT dbms_random.string('A', 5) RNDMSTR from xx --只有字母
SELECT dbms_random.value(2, 5)RNDMSTR from xx --亂數區間2~5
imp username/password@sid
EXP username/password@sid file=c:\DB\OOO\ZZZ.DMP log=c:\DB\OOO\ZZZ.log
exp 不要匯出資料 rows=no
exp username/password@sid FILE=/prod2/dbwork/expdata/EXP_A6417K01_H1.dmp tables=A6417K01
QUERY=\"where SYSDAT \< \'20090930235959\' and K1DEAL \<> \'1\'\"
log=/prod2/dbwork/expdata/EXP_A6417K01_S1.log ROWS=y GRANTS=y
select username,sid,serial# from v$session where username='USER_NAME';
USERNAME
|
SID
|
SERIAL#
|
USER_NAME
|
37
|
41363
|
USER_NAME
|
47
|
25604
|
USER_NAME
|
158
|
14321
|
alter system kill session'37,41363';
select t2.username,t2.sid,t2.serial#,t2.logon_time
from v$locked_object t1,v$session t2
where t1.session_id=t2.sid order by t2.logon_time
select sql_text from v$session a,v$sqltext_with_newlines b
where DECODE(a.sql_hash_value, 0, prev_hash_value, sql_hash_value)=b.hash_value
and a.sid ='245' order by piece
alter system kill session '235,714'
with a as
(
select * from member,
(
SELECT name,org_id,COUNT(*)
FROM member
GROUP BY name,org_id
HAVING COUNT(*) > 1
)t
where member.name=t.name
and member.org_id=t.org_id
)
select id from a
WHERE a.id!=(select max(id)from a)
FUNCTION IS_NUMBER (p_str IN VARCHAR2)
RETURN INTEGER
IS
v_num NUMBER;
BEGIN
v_num := TO_NUMBER (p_str);
RETURN 1;
EXCEPTION
WHEN OTHERS
THEN
RETURN 0;
END;
select * from your_table where is_number(your_field)=0
SELECT ceil(3.12) FROM DUAL;
執行結果:4SELECT floor(3.6) FROM DUAL;
執行結果:3SELECT round(3.16,1) FROM DUAL;
執行結果:3.2
INSERT INTO MarsTest (ID_, Content)
VALUES (Seq_MarsTest.NEXTVAL, 'MarsTest');
Select *
From ( Select *
?????? From 表格名稱
?????? Order By dbms_random.random )
Where Rownum <= 10;
SELECT * FROM (SELECT ROWNUMAS rn, FORT.* FROM FORT WHERE <10 ORDER BY ID) WHERE rn > 5 ORDER BY ID
--顯示 ID 11 12 13 15資料
select *
from (selet rownum as rn,t1.* from a where ...)
where rn >10
SQL>select * from(select rownum no ,id,name from student) where no>2;
NO ID NAME
DECODE(欄位,xx,oo,**)
如果欄位=xx 會變oo
decode(條件,值1,翻譯值1,值2,翻譯值2,...值n,翻譯值n,缺省值)
select decode(sign(變量1-變量2),-1,變量1,變量2) from dual; --取較小值
sign()函數根據某個值是0、正數還是負數,分別返回0、1、-1
create or replace view
v_sale(year,month1,month2,month3,month4,month5,month6,month7,month8,month9,month10,month11,month12)
as
select
substrb(month,1,4),
sum(decode(substrb(month,5,2),'01',sell,0)),
sum(decode(substrb(month,5,2),'02',sell,0)),
sum(decode(substrb(month,5,2),'03',sell,0)),
sum(decode(substrb(month,5,2),'04',sell,0)),