idip 自己写的语句

SELECT e.entryname 'name',e.entrytype 'type',IF(e.isarr=2,TRUE,FALSE) isarr,m.value 'value',e.entrydesc 'desc',e.id id FROM proto_struct_entry e LEFT JOIN net_macro m ON m.name = e.entrysize WHERE (e.structid =812 AND e.pid=0 ) OR (e.structid =812 AND e.pid !=0 AND e.isarr = 2);
SELECT id FROM `proto_struct_entry` WHERE (structid =812 AND pid=0 ) OR (structid =812 AND pid !=0 AND isarr = 2) OR (structid =813 AND pid=0 ) OR (structid =813 AND pid !=0 AND isarr = 2);
INSERT INTO NB_kfq_zs (shi,kfq,kfqtype,nian,mon) SELECT shi,kfq,kfqtype,nian,CONVERT(VARCHAR(7),getdate(),120) FROM NB_kfq_zs
 
 
 
insert into table select * from table where id ="" 复制一条记录
INSERT INTO `proto_struct`(NAME,des,oflag,gameid) SELECT NAME,des,oflag,90 FROM `proto_struct` WHERE id =822
 
 
case gameid when -1 then 90 when -2 then 100
INSERT INTO `proto_struct`(NAME,des,oflag,gameid) SELECT NAME,des,oflag,case gameid when -1 then 90 when -2 then 100  FROM `proto_struct` WHERE id =822
 
$sql = 'SELECT e.entryname `name` ,IF(e.pid =0,LOWER(e.entryname), "list") c_name,e.entrydesc `desc`,e.pid pid, IF(e.entrytype ="string",1,e.isarr) isarr ,(SELECT a.entryname FROM proto_struct_entry a WHERE e.pid=a.id ) pid_name FROM proto_struct_entry e WHERE id in ('.$entryids.")";
posted @ 2012-06-26 10:15  holyes  阅读(180)  评论(0编辑  收藏  举报