Skip to content

Tag: sql

Use Aggregate Function in UNION ALL result set

How can I use aggregate Functions in UNION ALL Resultset FOR EXAMPLE Result Set Would Be When I tried to get MAX(A) it returns 3. I want 6. When I tried to get MAX(B) it returns 4. I want 7. Other than Max(), Can I get another aggregate function which user defined? For example: (SELECT TOP 1 A WHERE B=5)

Group query results by month and year in postgresql

I have the following database table on a Postgres server: I would like to create a query that gives the SUM of the Sales column and groups the results by month and year as follows: Is there a simple way to do that? Answer At the request of Radu, I will explain that query: to_char(date,’Mon’) as mo…

update data with connected ado.net layer

I’m trying to perform update operation on winform using connected ado.net layer. here’s the code using this query I’m getting exception $exception {“Dynamic SQL ErrorrnSQL error code = -104rnToken unknown – line 1, column 15rn(“} System.Exception {FirebirdSql.Data.FirebirdC…

SQL server Nvarchar parameters

I Have created an SP to search against many tables in the db based on string sent form ado the Vb code and the SQL SP is : As you can see I have declared argument in VB as Nvarchr and SQL parameter @SearchKey as Nvarchar also if I send english data in @SearchKey search returns correct data, but if