npgsql

1.基本查询语句

 var sqlStr = $"select "FileCatalogId" from "RoadPlatformDatas" where "RoadPlatformDataType" = '1' and "Year" = '2019'";

这里查询的字段名称如果是大写需要加上双引号。如果不加npgsql会将其全部转换为小写。

2.分页

 sqlStr = $"select "qlbm","qlmc","centerzh"  from "{tableName}" where "xzqh" =  '{input.AreaCode}' LIMIT {input.MaxResultCount} OFFSET {input.SkipCount+1}";

LIMIT 5 OFFSET 2。5表示查询5行,2表示起始点从第二行开始。

原文地址:https://www.cnblogs.com/maycpou/p/13590100.html