Results 1 to 8 of 8
Nov 9, 2012, 07:41 #1
[MySQL 5.0.45-community-nt-log] Use LIMIT in query Update
Hello there, I need your help.
I have this output with query COUNT and GROUP BY `Identified` and `store`, execute in `tbl_quantity`:
quantity Identified store 12 115961 NY 3 115961 BS
I need update the selected quantity and not make available the number of rows quantity.
The user choose `quantity` 5 for `Identified` 115961 and store `NY`, this is the new output:
quantity Identified store 7 115961 NY 3 115961 BS
UPDATE `tbl_quantity` AS t JOIN `tbl_registry` AS e ON t.store = e.store SET available = 'No' WHERE 1 AND Identified = '115961' AND t.store = 'NY' AND id IN ( SELECT id FROM ( SELECT id FROM `tbl_quantity` ORDER BY id ASC LIMIT 0, 5 <=== the user choose `quantity` ) tmp );
[Err] 1052 - Column 'id' in IN/ALL/ANY subquery is ambiguousThanks you very much for your help
I'm really happy for your quickly answer.