列中的where子句完成

时间:2019-01-16 13:24:05

标签: sql sql-server tsql

所以我想做这样的事情:

Select *
from a
where something = 123 and (Select clause from table where id = 1)

该子句是where子句的完成,因为它可以是动态的,它取决于id,有什么方法可以做到吗?

1 个答案:

答案 0 :(得分:2)

您可以使用function Queue-Build { param ( [string] $BuildUri, [Hashtable] $Headers ) # Can't figure out how to assemble body $build = Invoke-RestMethod -Uri $BuildUri -Headers $Headers -Method Post -Body $body return $build } function Set-AuthHeaders { [CmdletBinding()] param ( [string] $UserName = "", [string] $AccessToken ) $basicAuth = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $UserName,$AccessToken))) return @{ Authorization = "Basic $basicAuth" } } # Azure DevOps settings $AccessToken = 'my_access_token' $vstsProjectUri = 'https://org.visualstudio.com/project' $vstsApiVersion = "5.0-preview.5" $headers = Set-AuthHeaders -AccessToken $AccessToken # Queue a new build $buildDefinitionUri = "$vstsProjectUri/_apis/build/builds?api-version=$vstsApiVersion" $buildQueueResult = Queue-Build -BuildUri $buildDefinitionUri -Headers $headers $buildQueueResult 执行动态查询,如下所示

execute