The Setup What I am about to describe is run on the following hardware: Disk: 6x 2TB HDD in RAID5 (w/ 1 redundant drive) CPU: Intel Xeon E5-2640 @ 2.4 GHz, 6 Cores RAM: 64 GB SQL Server Version: SQL Server 2016 Developer Both SQL Server Management Studio (SSMS) and the sql server instance are running on this …
Tag: sql
Trying to convert oracle sql to Sql Server date for a migration activity
Below is the oracle SQL query currently used in the existing system, I am trying to convert this SQL into a SQL Server query for the new system. I have been trying different format, but I am not successful and also since I am experienced in Oracle than SQL Server. Kindly help me in this regard. Answer Based M…
Is there a way to execute free Package statements using REXX?
I am able to write a REXX code that generates FREE PACKAGE statements. After generation I use that file in a JCL to execute the FREE PACKAGE statements. Is there a way to execute the FREE PACKAGE statements directly via rexx? I tried executing it like a normal query in REXX, but it throws -104 error. I believ…
What would be the T-SQL equivalent of the Oracle JSON_EQUAL Condition?
I have a table with a column that contains a JSON string. I need to query that table to find rows that match a given input JSON string. I would like to ignore order and formatting. ‘{ “foo”: “bar” }’ should equal ‘{“foo”:”bar”}’ ‘{ …
SQL query to create a merged table with varied timestamps and varied column mapping
I am trying to write an complex mySQL query in which there are 2 tables action and revenue what I need is: From auction table take out location, postal code on the basis of user, cat_id, cat and spent and join with revenue table which has revenue column so as that given cat_id, cat and date I can figure out
How to change SQL queries in Excel using VBA?
I have a workbook connected to a database that has stock data. I have around 500 stock symbol data and I fetch them one by one by entering the stock symbol (pink highlighted) in the query as shown below. All the time I have to open Connection Properties then Definition to change the stock symbol. This process…
Query optimization for multiple inner joins and sub-query
I need help regarding query optimization of the below query. Since there are duplicate joins in the main query and sub query, is there any way to remove those joins in the subquery? Answer Since, as you clarified, your sub-query is almost identical to your main query you might be able to use the window functi…
How to get output parameter results and query result from stored procedure?
I have this stored procedure which I call from C# using Entity Framework Core using a DbContext When I call the SP from code, the output parameters are empty. How to get the output parameter values in code? When I call the SP directly from SQL the output parameters are populated correctly. Answer You’re…
Is there a algorithm to resolve credit rating?
I need to implement a logic in either Java OR SQL for the following. There are credit ratings from numbers 1 to 11. And corresponding to each rating say x, I have 3 grades, effectively :x+, x and x-. Difference between each grade is termed as a step. For example, 2 and 2- is single(1) step,2+ and 2- is double…
SQL Joining One Table to a Selection of Rows from Second Table that Contains a Max Value per Group
I have a table of Cases with info like the following – ID CaseName Date Occupation 11 John 2020-01-01 Joiner 12 Mark 2019-10-10 Mechanic And a table of Financial information like the following – ID CaseID Date Value 1 11 2020-01-01 1,000 2 11 2020-02-03 2,000 3 12 2019-10-10 3,000 4 12 2019-12-25 …