持っている私がいる場合:特定のWHEREの列のすべての値を最大値に設定するにはどうすればよいですか?
2 baskets of oranges with 7 and 10 each
3 baskets of peaches with 12 and 15 each
その後、私は設定したい:私は
update baskets set maxfruit = (select max(fruitCount) from baskets b where b.fruit = fruit)
を試みたが、それだけで15にすべてを設定し
for every orange basket value of maxfruit to 10 and
for every peach basket value of maxfruit to 15
を...
これがうまくいけば試してみてください:maxfruit = maxfruit =(バスケットbからb.fruit = fruitを選んでmax(fruitCount)を選択してください)basket.fruit = 'fruit' – SGventra
全体のポイントに特定の名前を使用しないでください:( – Zeks
データを挿入するときにmaxfruit値をmaxに設定する必要があります。 – SGventra