Home  >  Article  >  Backend Development  >  如何改每行资料

如何改每行资料

WBOY
WBOYOriginal
2016-06-13 12:53:36808browse

怎么改每行资料?

本帖最后由 b234387 于 2013-02-19 21:02:02 编辑

怎么改每行资料?


可以教我在网页的SQL直接改 或用PHP改吗?


MySQL表

tabA
序  班   名额_限制   名额_使用   名额_剩   名额_水平
1    A                 5                 3               2                 2
2    B                 5                 1               4                 2
3    C                 5                 2               3                 1


第1种状况要:把"水平"=2的全部"限制"改成10、修改"剩"。

第2种状况要:把"水平"=2的全部"限制"+4、修改"剩"。

第3种状况要:全部"剩"都要正确。更新每行"剩" = "限制" - "使用"。


================

tabB
 A    B
"1" ->""
"2" ->"W"


怎么把"A"栏全部都复制到"B"栏呢?









------解决方案--------------------
第一个没看懂
第二个可以这样写:
update tabB set B=A ;
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn