我正在尝试通过选择最高数字并在其中添加1来更新MySQL中的多行来生成下一行。
UPDATE orders SET delivery_number = (
SELECT new_number FROM (
SELECT (
MAX(delivery_number) + 1
) AS new_number FROM order_invoice
) AS result
) WHERE delivery_number = 0 AND invoice_number != 0;
上面的查询似乎只有SELECT一次,然后为每次更新使用相同的数字。
如何强制它再次扫描表格以获得每次更新时的最高数字?
答案 0 :(得分:1)
Switch-AzureMode AzureResourceManager
$targetServicePlan = Get-AzureResource -Name my-serviceplan -OutputObjectFormat New
New-AzureResource -Name MyTestSite -Location "West Europe" `
-ResourceGroupName Default-Web-WestEurope `
-ResourceType 'Microsoft.Web/sites' `
-PropertyObject @{"name" = "MyTestSite"; "ServerFarmId" = $targetServicePlan.ResourceId } `
-OutputObjectFormat New