Tuesday, October 14, 2008

combine 3 record into 1 record by stored in different field

combine 3 record into 1 record by stored in different field
original
GameID CODESTATUS COUNT
====== ========== =======
GAMEA A 5
GAMEA T 10
GAMEA R 15

TO

GAMEID A_STATUS T_STATUS R_STATUS
======== ======== ========= ==========
GAMEA 5 10 15

===================================================

select gameid, count(gameid) as count, sum(aCount) as Available,sum(tCount) As Taken,sum(rCount) as Reserved from (
select gameid, codestatus,
case when codestatus='A' then 1 else 0 end as aCount,
case when codestatus='T' then 1 else 0 end as tCount,
case when codestatus='R' then 1 else 0 end as rCount
from tibsadmin.gamename_code
) as a group by (gameid)

Monday, October 06, 2008

WINDOW.OPEN using POST instead of GET

function toPreview(f) {

f.action = "";

f.onsubmit = "return true;";
f.target ="preview";

var theHeight = 550;
var theWidth = 480;
var theTop=(screen.height/2)-(theHeight/2);
var theLeft=(screen.width/2)-(theWidth/2);
var features='height='+theHeight+',width='+theWidth+',top='+theTop+',left='+theLeft+",scrollbars=yes";
window.open('','preview',features);
}