在JSTL裡,判斷欄位是否為空值
用 empty
ex: empty each.remCuser 判斷rmeCuser為空的
not empty each.remCuser 判斷rmeCuser不為空的
2013年7月31日 星期三
[JAVA]比對Collection的值是否一樣
可以用containsKey去檢查map的key是否一樣
如此就不用一個一個去比對
http://www.roseindia.net/tutorial/java/core/hashMap/containsKey.html
如此就不用一個一個去比對
http://www.roseindia.net/tutorial/java/core/hashMap/containsKey.html
HashMapContainsKey.java
package net.roseindia.java;
import java.util.HashMap;
public class HashMapContainsKey {
public static void main(String[] arr) {
/* Create object of HashMap */
HashMap<Integer, String> obMap = new HashMap<Integer, String>();
/* Add value in HashMap */
obMap.put(new Integer(1), "Bharat");
obMap.put(new Integer(2), "Gyan");
obMap.put(new Integer(4), "Vrishti");
obMap.put(new Integer(3), "Sarika");
obMap.put(new Integer(5), "Rohit");
obMap.put(new Integer(6), "Parineeta");
/* Check key present in HashMap or not */
System.out.println("Returns :" + obMap.containsKey(1));
System.out.println("Returns :" + obMap.containsKey(8)); } }
|
2013年5月9日 星期四
[jQuery] 取得被選取的 checkbox
$('input[name="firstname"]:checked').val();
http://blog.miniasp.com/post/2011/04/26/jQuery-get-form-value-Checkbox-Radio.aspx
2013年4月14日 星期日
[sql]DATE to Char
time zone
select to_char(sysdate, 'MON', 'NLS_DATE_LANGUAGE=american') from dual;
Reference:
http://sqle.ru/index.php/Oracle_PL/SQL/Date_Timezone/Date_Format#Change_the_original_date_format_in_the_TO_CHAR_function
http://www.toadworld.com/KNOWLEDGE/KnowledgeXpertforOracle/tabid/648/TopicID/SQL52F46/Default.aspx
http://gogates.blogspot.tw/2011/09/use-of-nlsdatelanguage-parameter-in.html
select to_char(sysdate, 'MON', 'NLS_DATE_LANGUAGE=american') from dual;
Reference:
http://sqle.ru/index.php/Oracle_PL/SQL/Date_Timezone/Date_Format#Change_the_original_date_format_in_the_TO_CHAR_function
http://www.toadworld.com/KNOWLEDGE/KnowledgeXpertforOracle/tabid/648/TopicID/SQL52F46/Default.aspx
http://gogates.blogspot.tw/2011/09/use-of-nlsdatelanguage-parameter-in.html
2013年3月5日 星期二
[SQL]將用分號將字串切割,並切換多行
select regexp_substr(mystring,'[^,]+',1,level) element
from dual
connect by level <= length(regexp_replace(mystring,'[^,]+')) + 1
Reference:http://stackoverflow.com/questions/4004377/splitting-comma-separated-string-in-a-pl-sql-stored-proc
2013年2月26日 星期二
[SQL]反向查詢吃不到INDEX
剛剛在看文件的時候看到
select 的條件若有 <> 時會吃不到Index
另外也儘量不用 not in
可以用not exists or in ( select ... from table1 minus select ... from table2)
以上可以提升效能
http://stackoverflow.com/questions/3545323/why-the-select-from-table-where-id-not-in-list-of-int-ids-query-is-slow-in
select 的條件若有 <> 時會吃不到Index
另外也儘量不用 not in
可以用not exists or in ( select ... from table1 minus select ... from table2)
以上可以提升效能
http://stackoverflow.com/questions/3545323/why-the-select-from-table-where-id-not-in-list-of-int-ids-query-is-slow-in
2013年2月22日 星期五
[SQL]optimal not in performance
若使用not in 的效能很差
可以改用minus可以提升效能
可以改用minus可以提升效能
http://dbaforums.org/oracle/index.php?showtopic=21583
http://www.dba-oracle.com/oracle_news/2005_3_31_tips_using_not_exists_minus_sql.htm
http://www.dba-oracle.com/t_cbo_existence_queries.htm
訂閱:
文章 (Atom)