Hi!
I used below code in c# and postgres database not worked.
{"ERROR: 42601: syntax error (approximate location: \" select \ ")"}
public DataTable searchAgrSps()
{
string query = "";
DataTable dt = new DataTable();
NpgsqlCommand cmd = con.CreateCommand();
query = "select spec, '' as year, cast('' as money) as Money, cast('' as money) as MNine, cast('' as money) as Corresp, cast('' as money) as SecEduc, cast('' as money) as Master, cast('' as money) as Phd into result from tblspecial";
query += " select distinct DENSE_RANK() OVER (ORDER BY Spec)as Id, Spec, Year, Money, MNine, Corresp, SecEduc, Master, Phd from result";
query += " drop table result";
cmd.CommandText = query;
con.Open();
try
{
dt.Load(cmd.ExecuteReader());
}
catch { };
con.Close();
return dt;
}