2010年7月30日 星期五

多表取不重複值

兩章表...找出範圍內的所有值..並且不重複
● union all 重複
● union 不重複

group by 是決定重不重複的關鍵。


select
*
from (
select
ProductName, Money
from
TABLE_A
where
Time between '2009-08-04' and '2010-05-07'

union all

select
ProductName, Money
from
TABLE_B
where
Time between '2009-08-04' and '2010-05-07'
) as tmp
group by ProductName, Money

2010年7月29日 星期四

異地


當我

一個人踏上異地之鄉,
面對襲捲而來的孤寂。
精神上的抨擊,
就像沙漠中的駱駝,
在記憶的沙漠中跟隨沙丘流浪著。
我沉浮在沙的沫浪中,
尋找心海的一根針。
思緒像失神的水母,
在意識的海洋中漫無目的漂流著。
漂呀!,漂呀!,漂。
我仍然漂浮著。

2010年7月14日 星期三

JQUERY loading條

HEAD內代碼


<script type="text/javascript">
<!--
jQuery(function(){
jQuery('#loading-one').empty().append('页面载入完毕.').parent().fadeOut('slow');
});
//-->
</script>


BODY內代碼


<p id="loading-one" style="color:#fff;position:absolute; top:50%; left:50%; margin:20px 0 0 -50px; padding:3px 10px;" onclick="javascript:turnoff('loading')">页面载入中..</p>
</div>
<script type="text/javascript">
//<![CDATA[
function turnoff(obj){
document.getElementById(obj).style.display="none";
}
//]]>
</script>




ps: firefox 沒感覺

參考文獻: http://medicine.javaeye.com/blog/601419

2010年7月13日 星期二

跟著捲軸移動的廣告

HTML ->


<div class="bigDiv">我是一個很長的區塊</div>

<div id="abgne_float_ad" >
<span class="abgne_close_ad">關閉廣告 [X]</span>
<a href="http://www.flycan.com.tw/course/course_javascript.php">
<img src="course_javascript.gif" title="JavaScript & CSS 互動程式入門班" />
</a>
</div>
</body>




CSS ->


display: none;
position: absolute;
}
#abgne_float_ad .abgne_close_ad {
display: block;
text-align: right;
cursor: pointer;
font-size: 12px;
}
#abgne_float_ad a img {
border: none;
}
div.bigDiv {
height: 3000px;
}



Javascript ->


$(window).load(function(){
var $win = $(window),
$ad = $('#abgne_float_ad').css('opacity', 0).show(), // 讓廣告區塊變透明且顯示出來
_width = $ad.width(),
_height = $ad.height(),
_diffY = 20, _diffX = 20, // 距離右及下方邊距
_moveSpeed = 800; // 移動的速度

// 先把 #abgne_float_ad 移動到定點
$ad.css({
top: $(document).height(),
left: $win.width() - _width - _diffX,
opacity: 1
});

// 幫網頁加上 scroll 及 resize 事件
$win.bind('scroll resize', function(){
var $this = $(this);

// 控制 #abgne_float_ad 的移動
$ad.stop().animate({
top: $this.scrollTop() + $this.height() - _height - _diffY,
left: $this.scrollLeft() + $this.width() - _width - _diffX
}, _moveSpeed);
}).scroll(); // 觸發一次 scroll()

// 關閉廣告
$('#abgne_float_ad .abgne_close_ad').click(function(){
$ad.hide();
});
});



範例瀏覽:
http://demonstration.abgne.tw/jquery/0024/0024_1.html
http://demonstration.abgne.tw/jquery/0024/0024_2.html
http://demonstration.abgne.tw/jquery/0024/0024_3.html(可關閉廣告)
http://demonstration.abgne.tw/jquery/0024/0024_4.html(位置在上)
http://demonstration.abgne.tw/jquery/0024/0024_5.html(位置在左上)

Ext JS 版:
http://demonstration.abgne.tw/extjs_3_x/0024/0024_1.html
http://demonstration.abgne.tw/extjs_3_x/0024/0024_2.html(可關閉廣告)
http://demonstration.abgne.tw/extjs_3_x/0024/0024_3.html(位置在上)
http://demonstration.abgne.tw/extjs_3_x/0024/0024_4.html(位置在左上)





參考文獻:http://abgne.tw/jquery/apply-jquery/jquery-window-scroll-ad.html/comment-page-1?replytocom=3997