2015年1月30日 星期五

html-menu css javascript html




 horizontal menu 

<script>
$('a[class="tabsa"]').click(function(){
$(".tabsa").css('color','black');
$(".tabsa").css('background-color','');
$(this).css('color','red');
//$(this).css('background-color','#FDA352');
});
</script>



<style>
.tabsX { width:100%; display:inline-block;}
.tabs li{ font-size: 100%; display:inline; margin-right:20px;font-color:black; }
.tabs li a:link  { color: blue; text-decoration: none; }
.tabs li a:visited  { color: #000000; text-decoration: none; }
.tabs li a:hover  { color: red; text-decoration: none;}
.tabs li a:active { color: green; text-decoration: none;}
</style>




<div class="tabs">
<img src="img/topNavLeft.jpg" width="80" height="22"><a href="b5_sucInfo.php">
<ul class="tab-links" style='display:inline-block;font-weight: bold;'>
<li><a class="tabsa" href="002.html" target="search_iframe">援助個案 2</a></li>
<li><a class="tabsa" href="http://www.bing.com" target="search_iframe">最新消息</a></li>
<li><a class="tabsa" href="003.html" target="search_iframe">慈善活動 3</a></li>
<li><a class="tabsa" href="003.html" target="search_iframe">活動剪影</a></li>
<li><a class="tabsa" href="005.html" target="search_iframe">捐款記錄 5</a></li>
<li><a class="tabsa" href="004.html" target="search_iframe">心靈分享 4</a></li>
</ul>
<img src="img/topNavRight.jpg" width="320" height="22" class="banner">
</div>

2015年1月27日 星期二

erp-procedure erp-payment_line mysql-loop




delimiter $$
drop procedure updatePaymentLineContra $$
CREATE PROCEDURE updatePaymentLineContra (
PAYH_RECORDID varchar(20))
BEGIN
DECLARE done INT DEFAULT FALSE;
declare v_SINV_RECORDID varchar(20);
declare V_contra_amount double;
declare V_contra_domain_amount double;

DEClARE payment_line_cursor CURSOR FOR SELECT SINV_RECORDID FROM PAYMENT_LINE WHERE PARENT_RECORDID=PAYH_RECORDID  ;

DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN payment_line_cursor;
get_recordid: LOOP
FETCH payment_line_cursor INTO v_SINV_RECORDID;
IF done THEN
LEAVE get_recordid;
END IF;
SELECT SUM(AMOUNT) ,SUM(DOMAIN_AMOUNT)
into V_contra_amount, V_contra_domain_amount
FROM PAYMENT_LINE
where SINV_RECORDID=v_SINV_RECORDID;
update PAYMENT_LINE SET CONTRA_AMOUNT=V_contra_amount
, CONTRA_DOMAIN_AMOUNT= V_contra_domain_amount WHERE RECORDID=v_SINV_RECORDID;
END LOOP get_recordid;
END;
$$
DELIMITER ;
CALL updatePaymentLineContra(1421804827732);

mysql-procedure-sum self-table-update with difference record updatePaymentLineContra



delimiter $$
drop procedure updatePaymentLineContra $$
CREATE PROCEDURE updatePaymentLineContra (
selfRecordid varchar(20))
BEGIN
declare V_contra_amount double;
declare V_contra_domain_amount double;
SELECT SUM(AMOUNT) ,SUM(DOMAIN_AMOUNT) 
into V_contra_amount, V_contra_domain_amount
FROM PAYMENT_LINE 
where SINV_RECORDID=selfRecordid;
update PAYMENT_LINE SET CONTRA_AMOUNT=V_contra_amount
, CONTRA_DOMAIN_AMOUNT= V_contra_domain_amount WHERE RECORDID=selfRecordid;
END;
$$
DELIMITER ; 
CALL updatePaymentLineContra(1421404507881);


2015年1月22日 星期四

2015年1月21日 星期三

erp-inv


/* print */

amount = invtotamt
amount = pinvtotamt
detail.amount=PRINT_INV_LINE.AMOUNT


/* view */
CUSTOMER_INVOICE_HEADER_VIEW1
CUSTOMER_INVOICE_HEADER_VIEW1

/* view os */
SOHD_DNBODYOS <-= SOHD_DNBODY <= SODNBODY <= DNBODY <=  dnote_line
select DNOTE_NO from SOHD_DNBODYOS;

2015年1月18日 星期日

generator-div level

<div class=container-3>
<div class=row>
<div class=col-wd>
<h3><a href='#'>something</a> </h3>
<a href='#' class='btn btn-default'>read more</a>
</div></div></div>

2015年1月14日 星期三

mysql-index multiple index multi index

http://dev.mysql.com/doc/refman/5.0/en/create-index.html


CREATE INDEX TEMP0127 ON DNOTE_LINE (QTY);
ALTER TABLE DNOTE_LINE DROP INDEX TEMP0127;


create index idx on t1 (accountid, logindate);

 multiple index
create index orderid_productid on orders(order_id, product_id)
http://www.ovaistariq.net/17/mysql-indexes-multi-column-indexes-and-order-of-columns/

2015年1月12日 星期一

erp-grn


/* grn  but not dn  */

GRNQTYOS.view <= grnbody= GRN_LINE + DNBODY





/* erp-grn_line */

delimiter $$
drop trigger if exists GRN_LINE_UpdateActionAfterUpdate;
CREATE TRIGGER GRN_LINE_UpdateActionAfterUpdate
After Update ON GRN_LINE
FOR EACH ROW
BEGIN
declare mqty double;
select GRNQTY FROM GRNQTY WHERE PO_RECORDID=NEW.PO_RECORDID  INTO mqty;
UPDATE PO SET GRNQTY=mqty WHERE RECORDID=NEW.PO_RECORDID; 
select GRNQTY FROM GRNQTY WHERE PO_RECORDID=OLD.PO_RECORDID  INTO mqty;
UPDATE PO SET GRNQTY=mqty WHERE RECORDID=OLD.PO_RECORDID; 
END;
$$
delimiter ;
UPDATE GRN_LINE SET AMOUNT=0;
SELECT GRNQTY FROM PO; 




delimiter $$
drop trigger if exists GRN_LINE_DeleteActionAfterDelete;
CREATE TRIGGER GRN_LINE_DeleteActionAfterDelete
After Delete ON GRN_LINE
FOR EACH ROW
BEGIN
declare mqty double;
select GRNQTY FROM GRNQTY WHERE PO_RECORDID=OLD.PO_RECORDID  INTO mqty;
UPDATE PO SET GRNQTY=mqty WHERE RECORDID=OLD.PO_RECORDID; 
END;
$$
delimiter ;

ERP-PO



/* Report os */
POQTYOS.view  <=  pobody.view


/* print  */
detail.amount = PRINT_PO_LINE.amount , (poDetail3.java)
amount = PURCHASE_HEADER_VIEW0.PO_AMT = POTATAMT.PO_AMOUNT (allDocGenPDF.java)




/* table */

grnqty= grnqty.view (GRNQTY, PO_RECORDID)








/* trigger */

delimiter $$
drop trigger if exists GRN_LINE_UpdateActionAfterUpdate;
CREATE TRIGGER GRN_LINE_UpdateActionAfterUpdate
After Update ON GRN_LINE
FOR EACH ROW
BEGIN
declare mqty double;
select GRNQTY FROM GRNQTY WHERE PO_RECORDID=NEW.RECORDID INTO mqty;
UPDATE PO SET GRNQTY=mqty;
END;
$$
delimiter ;

2015年1月11日 星期日

java-right

java-money format


static String num2money(String money,int length){
String r="";
String endOfBacket="";
if(money.indexOf("-")>=0){
money=money.replace("-","");money="("+money;endOfBacket=")";
}
money="       "+money;
money=money.substring(money.length()-11,money.length())+endOfBacket;
r=money;
return  r;
}

mysql-maintenance


PROCEDURE ANALYZE

It is common that a table is created with conservative settings such as larger data type, or hestitate using ENUM. After running the database for a period of time, the actually data pattern will be eventually outlined. To easily determine if a table can be re-configured with smaller data type, you can use the PROCEDURE ANALYZE statement.

PROCEDURE ANALYZE() can help you determine whter columns can be redefined to a smaller data types. It can also etermine whether a column contains only a small number of values and could be defined as an enum.

select * from sales_order_head procedure analyse(10,256) \G
CHECK TABLE BR201312111529.SALES_ORDER_HEAD;
REPAIR TABLE  BR201312111529.SALES_ORDER_HEAD;

The Analyze table statement updates a table with information about the distribution of key values in the table. This information is used by the optimizer to make better choices about query execution plans.  This statement works for MyISAM and InnoDB tables.

The ANALYZE TABLE command should be used to improve performance by updating index distribution statistic of after large amounts of table data have changed.

ANALYZE TABLE   BR201312111529.SALES_ORDER_HEAD;

THE OPTIMIZE TABLE statement cleans up a MyISAM table by defragmenting it. This involves reclaming unused space resulting from deletes and updates, and coalescing records that have become split and sttore non-contiguously. OPTIMIZE TABLE also sorts the index pages if they are out of order and updates the index statistics.

OPTIMIZE TABLE   BR201312111529.SALES_ORDER_HEAD;

mysqlcheck --database world sample -uroot -pPassword




numeric field

numeric - field

salary
allowance
bonus
version
discount
qty
recordid
price
amount

payroll-employee

employee
idcardnumber
cupard
sex
married
spouseName
spouseHKID
resAddr
ppnum
sppnum
ptprint

DateOfComment
monthly notfixed-income
allowance
bonus
allowance
salary
startDateOfEmp
Bonus
placePrevous
PreviousEmployer

payroll-files

bankCSV
MPFCSVDN
PFDIR56F
genIR56PDF
PDFServlet

ir56b
ir56bUpdate
tableRead2
tableReadW
tablereadX
tableWrite
createRegularPayroll.jsp

2015年1月8日 星期四

itext-example

itext

landscape : http://itextpdf.com/examples/iia.php?id=90

generator-choice

generator-choice


config

selectedButtonCaption=Selected


layout

{object}
0.61,SOPOQTY.CHOICE,check:GRID,3%,100,_,,
{countChecked}0{/countChecked}
{tooltip}Sales Order No.{/tooltip}
{onChange}
var s1226=($('.SOPOQTY_NAME'+thisRowNo).val());
var s0107=($('.SOPOQTY_PVIA'+thisRowNo).val());
if ((currentEntity.trim()=="" & currentVIA=="") | (currentEntity.trim()==s1226.trim()  & currentVIA.trim()==s0107.trim())){
currentEntity=s1226;
currentVIA=s0107;
} else {
document.getElementById('SOPOQTY.CHOICE'+thisRowNo).checked=false;
preventDefault();
alert('Please Check the Same Supplier !');
/*_messagebox('Please Select the Same Supplier',0,16,'Choice Message ! ');*/
return false;
}
var i=0;
$('.SOPOQTY_CHOICE').each(function (){if(this.checked){i++;}});
if(i==0){currentEntity=''}
{/onChange}
{/object}

2015年1月7日 星期三

mysql-schedule -cron



http://www.mysqltutorial.org/mysql-triggers/working-mysql-scheduled-event/


 SHOW EVENTS \G



DELIMITER $$
DROP PROCEDURE UPDATE_TEMP_SUMMARY_VIEW01 $$
CREATE PROCEDURE UPDATE_TEMP_SUMMARY_VIEW01()
BEGIN 
truncate table TEMP_SUMMARY_VIEW01; 
insert ignore into TEMP_SUMMARY_VIEW01 select * from SOINVPOSUMMARY;
UPDATE FINISHED_JOB SET COUNT=COUNT+1 WHERE NAME='SO_SUMMARY';
END ;
$$
DELIMITER ; 

DROP EVENT UPDATE_TEMP_SUMMARY_VIEW01;
DROP EVENT IF EXIST UPDATE_TEMP_SUMMARY_VIEW01;
CREATE EVENT UPDATE_TEMP_SUMMARY_VIEW01
ON SCHEDULE EVERY 60 SECOND
DO CALL UPDATE_TEMP_SUMMARY_VIEW01();
CALL UPDATE_TEMP_SUMMARY_VIEW01();
SET GLOBAL event_scheduler = ON;
SELECT * FROM FINISHED_JOB;

SHOW EVENTS FROM UPDATE_TEMP_SUMMARY_VIEW01;

genertor-actionAfterRefresh

use in grid
place in the last column of grid

e.g. salesorder.txt
{actionAfterRefresh}
var confirmed=document.getElementById('SALES_ORDER_PO_DESC.CONFIRM'+editRow).checked;
var s050107=_lookup('SALES_ORDER_PO_DESC.recordID'+editRow);
var s050107a=lookupTable('RECORDID','PO.SODP_RECORDID',s050107);
if (PROCESSING_MODE=='P'){
document.getElementById('SALES_ORDER_PO_DESC.CONFIRM'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.VENDOR_PRODUCT_RECORDID'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.PRICE'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.UNIT'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.CUR'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.VENDOR_PARTNO'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.MAINTAIN_MTHS'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.MAINTAIN_TYPE'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.QTY'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.DISCOUNT'+editRow).disabled=confirmed;
document.getElementById('SALES_ORDER_PO_DESC.SQD_NO'+editRow).disabled=confirmed;
}
if (PROCESSING_MODE=='D'){
if (confirmed){
$('.SALES_ORDER_PO_DESC_MAINTAIN_TYPE'+editRow).css('pointer-events','none');
$('.SALES_ORDER_PO_DESC_UNIT'+editRow).css('pointer-events','none');
$('.SALES_ORDER_PO_DESC_VENDOR_PRODUCT_RECORDID'+editRow).css('pointer-events','none');
$('.SALES_ORDER_PO_DESC_CUR'+editRow).css('pointer-events','none');
$('.SALES_ORDER_PO_DESC_PVIA'+editRow).css('pointer-events','none');
}
}
if (s050107a!=''){
$('.SALES_ORDER_PO_DESC_PVIA'+editRow).css('pointer-events','none');
}
{/actionAfterRefresh}

2015年1月5日 星期一

generator-backup


/*$.fn.toggleCheck=function(){    if(this.tagName==='INPUT'){        $(this).prop('checked', !($(this).is(':checked')));    }}*/


if (MODE=='SINPUT') {
//_refreshv2('<%=masterTableName%>.STATUS',DISK_DOC_STATUS);
}




if (_setFocus!=''){
if (document.getElementById(_setFocus)){
setTimeout(function(){
document.getElementById(_setFocus).focus();
//document.getElementById("myAnchor").focus();
_setFocus='';
},500);
}
}


/*****************/
/*--*/


drop view if exists SUMMARY; 
CREATE VIEW SUMMARY AS 
SELECT 
DATE SOH_DATE
,SALES_ORDER SO_NO
,SALES_ORDER_HEAD.QD_NO QD_NO
,if(REPLACE(REPLACE(END_USER,'&','and'),',','')=REPLACE(REPLACE(CUSTOMER.NAME,'&','and'),',','') OR END_USER='',CUSTOMER.NO_2,concat(END_USER,' [',CUSTOMER.NO_2,']')) END_USER
,SALES_ORDER_HEAD.SUBJECT
FROM SALES_ORDER_HEAD
LEFT JOIN CUSTOMER ON CUSTOMER.RECORDID=SALES_ORDER_HEAD.CUSTOMER_NO
LEFT JOIN SALES_ORDER_INV_DESC ON SALES_ORDER_INV_DESC.PARENT_RECORDID=SALES_ORDER_HEAD.RECORDID
LEFT JOIN POCOUNT ON POCOUNT.SOH_RECORDID=SALES_ORDER_HEAD.RECORDID


EXPLAIN SELECT * FROM SUMMARY  WHERE SO_NO ='SOTC01403052';
SELECT * FROM SUMMARY  WHERE SO_NO ='SOTC01403052';

DROP VIEW IF EXISTS POCOUNT;
CREATE VIEW POCOUNT AS 

SELECT SUM(IF(GRN_QTY>=PO_QTY AND PO_QTY<>0,1,0)), SUM(IF(PO_QTY<>0,1,0)), SOH_RECORDID FROM POBODY GROUP BY SOH_RECORDID; 

/*************************

{object}0.5,SETTINGS.CREATE,button,0,0,:Create,,  {labelInLineStyle}display:inline;{/labelInLineStyle} {onclick}formRefresh=1;{/onclick} 
{subform}input.jsp?mode=SINPUT&input=pvia.txt&config=pviaConfig.txt&{/subform}  
{formInit}if (PROCESSING_MODE=='D'){$('button[buttonID="this.id"]').css('display','inline')} else {$('button[buttonID="this.id"]').css('display','none')}  ;{/formInit}
{/object}

{object}0.5,SETTINGS.REFRESH,button,0,0,:Refresh,,{onclick}location.reload();{/onclick} {labelInLineStyle}display:inline;{/labelInLineStyle}  {formInit}if (PROCESSING_MODE=='D'){$('button[buttonID="this.id"]').css('display','inline')} else {$('button[buttonID="this.id"]').css('display','none')}  ;{/formInit}
{/object}


/*************************/
 //SELECT SUPPLIER FROM SOQTYOS WHERE  ! FIND_IN_SET(TRIM(SUPPLIER),'1394705940696,232') >0;




























mysql server performance tuning mysql-tuning

You can run mysql service with all the default settings unchanged. However, those default settings are suitable for even the modest server. In mysql service runs on a server with modern hardware setup certain parameters than determine the server running environment (e.g. memory) should be change so that mysql service can utilize the power of the server.

By default, mysqld's memory settings are rather conservative and should be increased if possible. There are caches such InnoDB buffer pool which caches data and index information for InnoDB tables.

On the other hand, even the server is powerful. If queries are not optimized, resources may be wasted resulting a limited capacity of the serM
ver.

Tuning Memory Parameters
Memory is important because more memory allows for less swapping be the operating system and for larger buffers improving caching and reducing disk usage.

Typically, you set parameter values using options in the [mysqldd] section of an option file so that the server uses them consistently each time it starts. For system variables that are dynamic, you can change them while the server runs to test how the changes affect performance. After you determine optimum values this way, set them in the option file for use in subsequent server restarts.

You may get ideas of how to tune the parameters by looking at the sample files provided, we mentioned the my-innodb-heavy-4G.ini file, it may not be 100% fit for your system, but you can use it as starting point to save time.

[mysqld]
key_buffer_size=256M
table_cache=256
sort_buffer_size=1M
query_cache_type=ON
query_cache_size=16M

The Table Cache

When the server opens a table, it maintains information about that table in the table cache, which is used to avoidd reopening tables when possible. The next time a client tries to access the table, the server can use it immediately without opening the table again if it is found in the cache.

However, if the cache is full and a client tries to access a table that isn't found there, somee open table must be closed to free an entry in the cache for the new table. The table that is closed then must be reopened the next time a client accesses it.

The table cache is a global cache for all open tables, it is used to cache the status of individual tables.

If you mainly run simple queries on many tables, the table cache should be increased.

The MyISAM Key Cache
The key cache (key buffer) is a resource in which the server caches index blocks that it reads from MyISAM tables. The key_buffer_size system variable controls the size of the key cache.

Key buffer is a glbal buffer, it caches index blocks for MyISAM tables only.

You can create additional key caches and assign specific tables to them If a table is heavily used and you want to make sure that its inddex information never is displaced ffrom the cache by indexes from other tables, create a separate cache and dedicate it for use by the table.

set global city_cache.key_buffer_size=4194304;
cache index word.city in city_ache;
load Index into cache world.city; 

Query Cache

Mysql supports a query cache that greatly increases performance under condtions such that the server's query mix include  select statements that processed repeatedly and return the same results each time. Using the query cache can result in the tremendous performance boost and reduction in the server load, especially for disk-or-processorr-intensive queries;

The query cache is global , so a query result placed in the cache can be returned to any client that has the necessary privileges for the tables referred to by the query.


Show variables like 'query_cache%';

Configuring Query Cache

my-opts.cnf

[mysqld]
innodb_file_per_table
federated
log-output=FILE,TABLE
log-slow-queries=sysslow.log
log-bin=sysbinary
sys_binlog=1
query_cache_type=1
query_cache_size=20M
query_cache_limit=2M


Modify query cacche value during Mysql runtime

set global query_cache_type=on;
set global query_cache_size=10485760;
set global query_cache_limit=1048576;

Turn on / off query cache

set session query_cache_type=on;

set session query_cache_type=off;

Measuring Query Cache Unilization

Show status like 'Qcache%';

Sort Buffer

The sort buffer is used ffor operations such as order by and group by.

sort_buffer_size

Join Buffer

join_buffer_size

Record Buffer

It is used to perform sequential table scans, reducing the number of reads from disk.

read_buffer_size

The Explain Statement

Explain select * from sample.employees;

Explain produces serveral columns of information. In the example just shown, null is the possible_keys and key columns shows for the first query that no index is considered available or usuable for processing the query.

For the second query, the table's PRIMARY KEY column (the Code column that contains three-letter county codes) can be used , and is in fact the index that the optimizer would choose. The rows column of the Explain output shows the effect of this difference.

The ROWS column indicates the total rows to be read in the EXPLAIN SELECT statement.

For the first query, the value is 240, which happens to be the number of rows in the Country table. In other words, My/sql wouldd scan all rows of the table, which is inefficient.

For the second query, only one row need be examined. This is because MySQL can use the table's primary key to go directly to the siingle relevant row.

As a result, we can conclude that we should use the code column rather that the country column of possible to look up Country tablee records.

EXPLAIN  is useful even for simple statement of this kindd. However, the real power of  EXPLAIN lies in which it can tell you about joins, which may selects multiple tables.

It is important to analyze queries that involve join with EXPLAIN because join havve the potential to cause more server processing if not defined correctly.

Analyzing Query

The following example demonstrates how to use EXPLAIN to analyze and optimize a sample query. The purpose of the query is a answer the querstion. Which cities have a population of more that 8 million and to display for each city its name and population, along with the country name.

This question could be answered using only city information, exceipt that to get each country's name reather that its ccode, city information must be joined to country information.

The example uses tables created from world database information. Initially, these tables will have no indexes, so EXPLAIN will show that the query is not optimal. The example then adds index and uses EXPLAIN to determine the effect of indexing on query performance.

Select countrylist.name , citylist.name, citylist.population from countrylist, citylist
where countrylist.code=citylist.coutry.code
and citylist.population > 800000;

For Country List, the value of ALL indicates a full scan of all rows. For CityList, the value of ALL indicates a scan of all its rows to find a match for each CountryList row. In other words , all combinations of rows will be checked to find country code matches between the two tables.

The number of row combinations is given by the product of the rows values, where rows represents the optimizer's estimate of how many rows in a table it will need to check at each stage of the join, In this case, the product is 240 x 4079 or 978980.

When Using  EXPLAIN on jining statements the total rows to be examined will be the product of row value in the EXPLAIN result.

EXPLAIN shows that MySQL would need to check nearly a million row combinations to produce a query result that contains only 10 rows. Clearly , this query would benefit from the creation of indexes that allow the server to look up infromation faster.

Alter table countryList add primary key (code) ;
alter table citylist add index(countryCode);

The possible_keys in the EXPLAIN SELECT shows if there are any indexes you maybe able to  use. When possible_keys column values is NULL , no index is considered available for this query.

When the Key values is NULL, no index could be used to perform the query, the number show next to rows represents the number of rows the table need to examined. You should index the column which being specified in a WHERE clause frequently.

If the value of the type column in a EXPLAIN is eq_ref, it means that the equality test is perfromed by referring to the column named in the ref field.

The ordering of tables shown in an EXPLAIN output determines the table from which data will read first.

The id value of EXPLAIN is just an incremental number to identify the rows from the output.

ref indicates which indexed column or columns are used to choose rows fromm the table.

The key_len represents the bytes will be used from index rows.

The result from EXPLAIN shows that indexing CountryList. Code as a primary key improves query performance. However, it still indicates a full scan of the CityList table.

The product of the rows now is just 4079. That's much better than 978960, but perhaps further improvement is possible. The WHERE clause of the query restricts CityList rows based on their population values, so try creating an index on that column.

Alter table citylist add index (population) ;

The query now is optimized. Note that the product of the rows values 11. To calculate the significant of the performance gain.

To hint the optimizer to use a particular index you can include the USE INDEX or FORCE INDEX in the EXPLAIN statement:

EXPLAIN SELECT * FROM table_name USE INDEX (INDEX_NAME) WHERE CONDITION

If you want to force MySQL to join table in a particular order, being the query with SELECT STRAIGNT_JOIN rather than SELECT , and then list the tables in the desired order in the FROM clause.

The optimizer does not need to read the data rows, and can return values from the index if those columns where specified in the SELECT statement.





























































2015年1月4日 星期日

mysql-android


http://sampleprogramz.com/android/mysqldb.php

kerby-menu

index.asp
menuH.asp
menuV.asp
useradd.asp -> findUser.asp
                   -> saveUser.asp
                   -> menulist.asp
                   -> menuadd.asp
                   -> savemenu.asp

connector: adodb.connection
- saveMenu
- menuList
- saveUser
- findUser
- menuH
- menuV
- index

edwardl
joanna

2015年1月1日 星期四

payroll-feature

create Termination Bank
create Termination MPF
last Pay Slip
create New Hire Bank
Earning Analysis
Payroll Entry Worksheet
Salary slip (Pay slip pdf.goship)

MPF
Bank

html-ascii table

http://en.wikipedia.org/wiki/Box-drawing_character


┌─┬┐  ╔═╦╗  ╓─╥╖  ╒═╤╕
│ ││  ║ ║║  ║ ║║  │ ││
├─┼┤  ╠═╬╣  ╟─╫╢  ╞═╪╡
└─┴┘  ╚═╩╝  ╙─╨╜  ╘═╧╛
┌───────────────────┐
│  ╔═══╗ Some Text  │▒
│  ╚═╦═╝ in the box │▒
╞═╤══╩══╤═══════════╡▒
│ ├──┬──┤           │▒
│ └──┴──┘           │▒
└───────────────────┘▒
 ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒