|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
update column
The current version 4.0.15-standard does not support this update. can anyone help PLEASE!
update tabA set ColA = (select count(*) from tabB where colC = 1 and colD>0) where colC = 1; This works fine in 4.1x |
|
#2
|
|||
|
|||
|
RE: update column
split it into two queries...
[highlight=php] <? $query="select count(*)as count from tabB where colC = 1 and colD>0"; $result = msql_query($query); if (mysql_num_rows == 1){ $row =mysql_fetch_array($result); $updtquery="update tabA set ColA = $row[count]where colC = 1"; $resultupdt = mysql_query($updtquery); }else{ echo "update not performed"; } not very pretty, but effective |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > update column |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|