Created table named geosalary with columns name, id, and salary: name id salary patrik 2 1000 frank 2 2000 chinmon 3 1300 paddy 3 1700 I tried this below code to find 2nd …
Tag: sql
Oracle case inside where clause
This is a simple question, I’ve read some details about using CASE in WHERE clause, but couldn’t able to make a clear idea how to use it. The below is my sample query: 1 SELECT * FROM dual 2 …
SqlCommand INSERT INTO query does not execute
Hello guys I have got this code: It should insert data from textboxes: kname, ksurname, but it closes the form without showing them in MS SQL table klient Answer Missing the ExecuteNonQuery call A command should be executed to update the database…
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)
What does the ( ‘ > ) symbol mean in the command line in MySQL?
I’m new to sql and for some reason, the arrow symbol ( -> ) that I am used to seeing in teh command line, which mean it is ready for input, is now displayed as ( ‘> ) and it does not accept commands. What does it mean and how do I get back to ( -> ) ? Thanks
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
Using COUNT in GROUP_CONCAT
This is my table: id | fk_company ——————- 1 | 2 2 | 2 3 | 2 4 | 4 5 | 4 6 | 11 7 | 11 8 | 11 …
Joining two tables with specific columns
I am new to SQL, I know this is really basic but I really do not know how to do it! I am joining two tables, each tables lets say has 5 columns, joining them will give me 10 columns in total which I …