|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
sql help
The query below works BUT i am trying to use the logic in a update statement. So the limit has to go. can anyone help get first 4 rows without using the limit?
SELECT tabA.colA FROM tabA, tabB WHERE tabA.colC = 1 AND tabB.colD >= 4 AND tabA.colA > 0 limit 4 Thanks |
|
#2
|
|||
|
|||
|
RE: sql help
Whish SQL?
MySql: UPDATE tabA, tabB SET tabA.someCol = someValue WHERE tabA.colC = 1 AND tabB.colD >= 4 AND tabA.colA > 0 LIMIT 4; |
|
#3
|
|||
|
|||
|
RE: sql help
If you don't want to do that you could probably get the id's of the first four rows and then use those id's when updating them.
You should lock the tables if you do this, however, so I think the previous suggestion is better. |
|
#4
|
|||
|
|||
|
RE: sql help
i need help . i would like to know how to add an id into 2 tables. what i mean is i want to add an id into a table name " mb01lnum ". and then i want use the id to insert into another table name " mb02mklmbls " .
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > sql help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|