I am using R package RODBC to connect HANA. One of the columns is like a long integer, but actually used as a string such as 2772161413309, 4239530000000239. SQL takes such data as integers. In R, …
Tag: sql
using conditional where clauses in mysql select statement
There is a stored procedure sp_select_from_persons in MySql. And there are 3 parameters inside this procedure. age, class, group. These parameter values can be -1 or another value. And these …
SQL BACKUP and Restore Full backup
I have two full backups of different dates first full backup is of date lets suppose 21-05-2017 and I have restored that backup to client machine (RESTORE WITH NO RECOVERY) and now I got second full back on date : 26-05-2017 , now I want to restore that full backup on previous restored Full back on my client …
How to retrieve current month in SSRS expression
I want to get current month as default value of a parameter. I’ve come up with (which does not work): Answer If you want to get the month as an int that goes from 1 to 12, you can use this This answer was based on the official documentation that you can see in here – http://technet.microsoft.com/e…
SQL query Compare two WHERE clauses using same table
I am looking to compare two sets of data that are stored in the same table. I am sorry if this is a duplicate SO post, I have read some other posts but have not been able to implement it to solve my problem. I am running a query to show all Athletes and times for the most recent date
Union of arrays as aggregate function
I have the following input: I want the following output: I am grouping by name. For each group, the count should be aggregated as the max and the options should be aggregated as the union. I am having troubles figuring out how do the the latter. Currently, I have this query: http://rextester.com/YTZ45626 I kn…
Converting an Oracle date (stored as a number) in a SQL OPENQUERY
I am trying to create a number of stored procedures in SQL accessing an Oracle database. All dates in Oracle are stored as a 10 digit number which is causing some confusion. I have designed some dynamic SQL which allows us to run an OPENQUERY to pick out parameters however what I want to be able to do is use
How to compare time in mysql
I have a column of Time data type in mysql. I want to compare the time with a time string but don’t know how to compare it. e.g., I want to know that some specific time is greater than 10:30:00. How …
Insert a list using dapper.NET C#
I’d like to insert a list of objects in an SQL table. I know this question here but I don’t understand. Here is my class : I’d like to know how could I insert my list using Dapper, I don’t want to iterate on the list and save them one by one, I would like to insert all of them
SQL SUM Group by – based on ‘group’ from another table
I hope I am explaining this correctly. I have 2 tables, with first table (table1) +————+——+——-+——-+ | Date | Item | Block | Total | +————+——+——-+——-+ |…