Viewing 15 posts - 1 through 15 (of 4,037 total)
I'm not the OP. The UDF (dbo.fnTally) is a well know one by Jeff Moden and the OP is using this in his original post.
The depth...
May 7, 2024 at 3:55 pm
Not sure exactly what you want, but maybe something like this?
Create some data:
-- Creating the table
CREATE TABLE DrillingData (
PROJECT NVARCHAR(50),
...
May 7, 2024 at 2:50 pm
Many people are hesitant to open random files from the Internet. Here is a link on Forum Etiquette: How to post data/code on a forum to get the best...
May 7, 2024 at 1:54 pm
Admittedly your description is a bit vague, but it sounds like you are trying to force SQL into an object-oriented paradigm. For instance you mention "84 data values representing his...
May 2, 2024 at 3:31 pm
I've always thought you should only use inner join if you want to return columns from the other table, but this link suggests join is preferable if there is...
April 16, 2024 at 5:56 pm
This produces the exact same results as Jonathan's query with far fewer reads.
WITH CTE AS
(
SELECT xp.RBDTYR
...
April 11, 2024 at 7:56 pm
The problem is that you chose to create a DENORMALIZED names table. It sounds like you're early enough to change this to NORMALIZED. That will fix your problems.
Drew
April 11, 2024 at 2:22 pm
Please create sample data in a consumable format using the {;} Code
button to include a script to create a TEMP table and insert data into that temp table.
Drew
April 11, 2024 at 2:12 pm
Drew, your solution doesn't list the new company. It only lists the original one. Do you know why?
Yes, there was an error in my code. I was thinking that...
April 4, 2024 at 3:11 pm
Couldn't it be as straightforward as this??
SELECT t.[pick your columns]
FROM SomeTable t
INNER JOIN (SELECT [ID#]
...
April 3, 2024 at 8:15 pm
I used a calculated field to combine these into a single query.
WITH Stop_Fl AS
(
SELECT *
...
April 3, 2024 at 8:06 pm
This gives the exact same results as Jonathan's but only reads the near and next term data tables once each.
SELECT FP.UNDERLYING_SYMBOL,
...
April 2, 2024 at 6:46 pm
The problem with your question, is that you've not given enough data to rule out potential incorrect queries. For example, SELECT * FROM dbo.history
returns the correct results for your...
April 2, 2024 at 6:24 pm
You need multiple OPENJSON
functions.
select j.WorkId, r.[Busket Rule], r.Exit_Window, r.Startegy, r.Start_Date
from openjson(@json)
with (
WorkId int '$.WorkId',
OverrideRules NVARCHAR(MAX) '$.UpdateAttributes.OverrideRules' AS JSON
) j
CROSS APPLY OPENJSON(j.OverrideRules)
WITH (
[Busket Rule] varchar(200) '$."Busket Rule"',
Exit_Window...
April 2, 2024 at 5:53 pm
This gives the exact same results as Jonathan's but only reads the near and next term data tables once each.
SELECT FP.UNDERLYING_SYMBOL,
...
April 2, 2024 at 5:36 pm
Viewing 15 posts - 1 through 15 (of 4,037 total)