![](/img/trans.png)
[英]npgsql: How to select multiple rows (with multiple column values) with npgsql in one command with a collection as a parameter?
[英]Npgsql 5 a single select and multiple arguments
我使用 Npqsql 5。有什么方法可以使用單個選擇來檢索許多不同參數的值嗎? 例如我想運行:
"select value from table where id=@id1"
"select value from table where id=@id4"
"select value from table where id=@id12"
但作為單個查詢以進行優化。
想到的幾個選項:
select value from table where id = @id1 or id = @id4 or id = @id12
要么
select value from table where id in (@id1, @id4, @id12)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.