欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php编程SQL语句union all的使用编程

程序员文章站 2022-05-16 13:26:44
...
编程php信息

php编程SQL语句union all的使用编程
id分别是ishijian1,ishijian2,语句是

echo ' ';

?>

 

起始时间

截止时间

 



c_huizong.php
//订单查询
if ($_POST['1shijian1'])
{
echo "
document.getElementById('1shijian1').value='".$_POST['1shijian1'].
"';document.getElementById('1shijian2').value='".$_POST['1shijian2'].
"';cg1name();";

if ($_POST['1shijian1']NULL)
$shijian1=" and COPTC.TC003>=".$_POST['1shijian1'];
else
$shijian1="";

if ($_POST['1shijian2']NULL)
$shijian2=" and COPTC.TC003else
$shijian2="";

require_once('i_code/connect.php');

$query="select leixing,xifen,sewen,ddgm,bztdb,daba,SUM(TD008) AS TD008,SUM(TA015)TA015,SUM(RKZS)RKZS,SUM(D310)D310,SUM(D305)D305,SUM(D304)D304,SUM(D3023)D3023,SUM(TH008)TH008,SUM(TJ007)TJ007
FROM chaxun
LEFT JOIN DDTJMX ON MA003=leixing and xifen=XIFEN AND sewen=DDTJMX.UDF10 AND ddgm=DDGM and daba=XINGHAO
left join COPTC on TC001=DDTJMX.TD001 AND TC002=DDTJMX.TD002
where xifen'' and xifen'5050' and TC003>='20150110' AND TC003GROUP BY leixing,xifen,sewen,ddgm,bztdb,daba
union all
select leixing,xifen,null as sewen,null as ddgm,bztdb,null as daba,SUM(TD008) AS TD008,SUM(TA015)TA015,SUM(RKZS)RKZS,SUM(D310)D310,SUM(D305)D305,SUM(D304)D304,SUM(D3023)D3023,SUM(TH008)TH008,SUM(TJ007)TJ007
FROM chaxun
LEFT JOIN DDTJMX ON MA003=leixing and xifen=XIFEN
left join COPTC on TC001=DDTJMX.TD001 AND TC002=DDTJMX.TD002
where xifen='5050' and TC003>='20150110' AND TC003GROUP BY leixing,xifen,bztdb
union all
select leixing,null as xifen,null as sewen,null as ddgm,bztdb, null as daba,SUM(TD008) AS TD008,SUM(TA015)TA015,SUM(RKZS)RKZS,SUM(D310)D310,SUM(D305)D305,SUM(D304)D304,SUM(D3023)D3023,SUM(TH008)TH008,SUM(TJ007)TJ007
FROM chaxun
LEFT JOIN DDTJMX ON MA003=leixing
left join COPTC on TC001=DDTJMX.TD001 AND TC002=DDTJMX.TD002
where xifen='' and TC003>='20150110' AND TC003GROUP BY leixing,bztdb".$shijian1.$shijian2;

$result=mssql_query($query);
$row_num=mssql_num_rows($result);
if ($row_num0)
{
echo "


";
echo ";
;
;
;
;
;
;
;
;
;
;
;
;
";

while($row=mssql_fetch_assoc($result))
{
echo"

";

echo"

";
echo"";
echo"";
echo"";
echo"";
echo"";
echo"";
echo"";
echo"";
echo"";
echo"";
echo"";
echo"";
//跟踪信息
echo"
\n";

}
echo"

类别细分色温订单规模标准投单比打靶订单量预计产量总入库数标准入库销货数量销退数量跟踪信息
".$row['leixing']."".$row['xifen']."".$row['sewen']."".$row['ddgm']."".$row['bztdb']."".$row['daba']."".number_format($row['TD008'],0)."".number_format($row['TA015'],0)."".number_format($row['RKZS'],0)."".number_format($row['D310'],0)."".number_format($row['TH008'],0)."".number_format($row['TJ007'],0)."跟踪信息

 

";
echo'';

}

mssql_close($conn);

}
?>

现在一运行语句是错的,是后面的语句里面的查询语句有错,求指正。

php编程SQL语句union all的使用编程

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频


网友评论

文明上网理性发言,请遵守 新闻评论服务协议

我要评论
  • php编程SQL语句union all的使用编程
  • 专题推荐

    作者信息
    php编程SQL语句union all的使用编程

    认证0级讲师

    推荐视频教程
  • php编程SQL语句union all的使用编程javascript初级视频教程
  • php编程SQL语句union all的使用编程jquery 基础视频教程
  • 视频教程分类
    相关标签: 编程 php 信息