我如何在数据库中进行编辑 [英] how can i edit in my database

查看:64
本文介绍了我如何在数据库中进行编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有[NSN],[Location],[Quantity]
的数据库
我想从数据库中删除只能从数量中删除的内容,

例[8888888],[pll],[7]如果我删除两个,则

[8888888],[pll],[5]
我该怎么做

我想删除项目[8888888]不要删除所有记录,而只删除此项目的数量分钟


例如,如果我要删除数量为7的itme [8888888],
它的数量变为6

i have database which have [NSN],[Location],[Quantity]

i want make from which i can delete from my recod if it found in database delete only from quantity

ex [8888888],[pll],[7] if i delete two then

[8888888],[pll],[5]
how can i make it

imean if i want to delete item [8888888] don''t delete all record but only make quantity of this item mins


ex if i want to delete itme [8888888] which its quantity 7
the its quantity became 6

推荐答案

如果7是一个标识字段,删除记录不会更改下一个记录的内容,即使是5,8,即使如果您删除了6和7.除此之外,您还问有关使用基本SQL进行基本数据库编程的问题,并且已将您的帖子标记为Linux,这意味着很难在这个以Microsoft为中心的网站上找到帮助. C ++对SQL和数据库一无所知,您需要外部库来实现.因此,假设您使用代码创建了数据库,请仔细阅读用于执行该SQL的方法,这可能与执行delete语句所需的内容类似.
If 7 is an identity field, deleting records does not change what the next record will be, it will still go 5,8, even if you deleted 6 and 7. Beyond that, you''re asking about basic database programming, using basic SQL, and you''ve tagged your post as Linux, which means it will be hard to find help on this Microsoft centric site. C++ has no idea about SQL and databases, you need external libraries to give you that. So, assuming you created your DB with code, read up on the methods you used to execute that SQL, it will probably be similar to what you need to execute delete statements.


您的困难是用术语删除".如果删除记录,那么将删除该记录-您已经说过不想这么做.因此,请停下片刻,想一想您说的是什么,然后对自己确认删除不是您想要的.现在想想你想要什么.您写道,您想使该记录的数量字段不同.我想到的是更改,修改或更新.现在,您可以转到数据库文档,查看是否可以找到类似的内容.祝你好运.
Your difficulty is with the terminology "delete". If you delete the record, that would, well, delete the record - which you have said you don''t want to do. So stop a moment, think about what you said, and acknowledge to yourself that delete is NOT what you want. Now think about what you do want. You wrote that you wanted to make the quantity field of of this record different. Words that come to my mind for this are change, modify, or update. Now you can go to your database documentation and see if you can find anything like that. Good Luck.


这篇关于我如何在数据库中进行编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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