Viewing 15 posts - 31 through 45 (of 1,413 total)
Regarding the precision of the data types
cast(Price as decimal(9,7)) Calculation
The line above CAST's the price (Price) to DECIMAL(9, 7). Imo this is not a good practice. When...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
My query was insufficient because it applied the factor percentage to the lagged price and not to the lagged calculated price. It seems recursion is unavoidable. This query uses a...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
Why are you using these data types with this numerical precision? By making @Factor DECIMAL (9,7) and applying this percentage to a price it adds significance to decimal places to...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
One way to unpivot unique values (of columns [Emp_1], [emp_2], [Emp_3]) could be to CROSS APPLY their UNOIN. The syntax might appear to be unusual because the subquery doesn't contain...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
with stub_cte as (
select BName, StartDate, StartTime,
lag(StartDate) over (partition by v.stub...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
The @dateChoice variable is passed in from a dropdown box and the WHERE clauses between the two queries are different. Syntax-wise you could try IF @dateChoice = 'DOS' SELECT ... ...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
The only relational operator which seems required is a partial CROSS JOIN of #tmp (WHERE 'parent_id' IS NULL) to #tmp (WHERE 'parent_id' IS NOT NULL) ON 'uniqueid'. Then it's a...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
In your JSON the outermost delimiter is an array bracket which means it's an anonymous array. To reference the only record in the array you could provide the 'path' to...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
In the function JSON_VALUE 'path' is a required parameter and in the tvf OPENJSON 'path' is optional. The implementation of 'json path' in SQL Server is a limited subset of...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
Viewing 15 posts - 31 through 45 (of 1,413 total)