如何在Mysql中插入附加行 [英] How Do I Insert An Additional Row In Mysql

查看:105
本文介绍了如何在Mysql中插入附加行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MySql中,

如果我的程序返回的详细信息如



In MySql,
If my procedure return details like

FromDate      ToDate        Data        Value
----------------------------------------------
2004-01-01    2014-01-01    Data1       100
2014-01-01    2020-01-01    Data1       20
2014-01-01    2020-01-01    Data2       50
----------------------------------------------



这里的时间段[2004-01-01至2014-01-01]缺少Data2。所以如何输入像

这样的行


Here for the time period [2004-01-01 to 2014-01-01] Data2 is missing.So how it possible to enter a row like

2004-01-01    2014-01-01     Data2       0

推荐答案

are! [ ^ ]


insert into table1 values('2004-01-01', '2014-01-01', 'Data2', 0)



mysql_insert [ ^ ]


请检查存储过程用于返回结果的查询。

您需要检查是否应用了任何过滤条件以排除此类值0记录。如果是,则删除它。



您还必须检查相关表中是否存在任何此类数据。如果否,则首先确保您的表具有所需数据。
Please check the query your stored procedure is using to return the results.
You will need to check if there is any filter condition applied to exclude such 0 valued records. If yes then remove it.

You will also have to check if any such data exists in the related table. If no then first ensure that your tables have the required data.


这篇关于如何在Mysql中插入附加行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆