Viewing 11 posts - 1 through 11 (of 11 total)
Correct answer:
Yes, you can run this code, This returns 97
Explanation:
You can run this code. The CHAR variable is converted to NCHAR and the first character's value returned. An...
May 5, 2016 at 11:19 pm
Here is a dynamic version of Alan's answer:
CREATE TABLE Licenses(
RegID INT,
License# ...
April 25, 2016 at 12:41 am
Here is a related blog by Aaron Bertrand: sqlperformance.com/2012/12/t-sql-queries/left-anti-semi-join
October 22, 2015 at 2:25 am
Nice article. Although I still prefer Jeff Moden's dynamic crosstab approach:
DECLARE @sql NVARCHAR(MAX) = ''
SELECT @sql =
'SELECT
TableName' + CHAR(10)
SELECT @sql = @sql +
', AVG(CASE WHEN YEAR(CreatedDate) = ' +...
October 22, 2015 at 1:45 am
Lowell (10/5/2015)
they added code that insta-deletes anything Celko posts(thank you for that!)
So that's why I received an email saying:
A new reply has been added by CELKO to a topic...
October 14, 2015 at 1:55 am
Great explanation particularly on the RANGE and ROWS clause. Thanks very much for this.
October 14, 2015 at 12:31 am
Phil Parkin (10/12/2015)
Nice code, Felix.Quick suggestion...
Not sure how quick it was though; have you been listening to Eirikur?
Yeah! I've been lurking this forum for quite some time now and decided...
October 12, 2015 at 1:31 am
Quick suggestion: Use dynamic crosstab:
-- Prepare Sample Data
CREATE TABLE INCIDENT(
IDINT PRIMARY KEY,
[Date]DATE
);
CREATE TABLE PEOPLE(
INC_IDINT FOREIGN KEY REFERENCES INCIDENT(ID),
PersonIterationINT,
ComplaintVARCHAR(20)
);
INSERT INTO INCIDENT VALUES(1, GETDATE());
INSERT INTO PEOPLE VALUES (1, 1, 'Head'), (1, 2,...
October 12, 2015 at 12:49 am
Try to rewrite this join.
Using such constructions in joins, especially when OR is involved is asking for trouble.
Try something like this:
...
left join objectA
on objectA.ID = case
...
October 2, 2015 at 1:16 am
Viewing 11 posts - 1 through 11 (of 11 total)