Viewing 15 posts - 6,331 through 6,345 (of 8,731 total)
This is untested, but it might give you an idea.
SELECT MedRecNum,
VisitID,
VisitDate,
MAX(CASE WHEN Answer <= 1 THEN Answer ELSE...
June 5, 2014 at 9:38 am
They don't seem extremely difficult. Unfortunately, many people will get them wrong.
It seems like a nice test which will separate good from bad ones. However, on question 2, the queries...
June 5, 2014 at 9:29 am
SQL is delicious (6/5/2014)
SQLRNNR (6/5/2014)
Great. I love that excuse "It's the way we/I have always done it".
That kind of excuse right there shows a base incompetence. Everything he...
June 5, 2014 at 9:26 am
If you insert your information into a properly normalized table, the rest is easier.
To do so, you can use the DelimitedSplit8K found in here: http://www.sqlservercentral.com/articles/Tally+Table/72993/
And work with something like this:
WITH...
June 5, 2014 at 9:01 am
Jeff Moden (6/4/2014)
Luis Cazares (6/4/2014)
sqldriver (6/4/2014)
June 4, 2014 at 5:28 pm
Hrhb.mail (6/4/2014)
My magical crystal ball can't find the error. Could you share it with us?
I need to add
Where CatId=1 (or etc.)
It causes an error
Where are you adding your conditions?...
June 4, 2014 at 3:52 pm
My magical crystal ball can't find the error. Could you share it with us?
June 4, 2014 at 3:29 pm
rn is the column that I added with the value of ROW_NUMBER() OVER(PARTITION BY n.NewTitle ORDER BY n.NewId).
If you need to know what ROW_NUMBER() does, read the following: http://technet.microsoft.com/en-us/library/ms186734(v=sql.105).aspx
June 4, 2014 at 3:22 pm
Basically, something like this?
WITH CTE AS(
SELECT ROW_NUMBER() OVER(PARTITION BY n.NewTitle ORDER BY n.NewId) rn,
n.NewId,
...
June 4, 2014 at 3:04 pm
Just another option based on the fact that you're using 2 columns.
WITH SampleData AS(
SELECT 'This is a test' [address], 'This' strtype UNION ALL
...
June 4, 2014 at 2:59 pm
Here's the whole code with no errors.
What rules do we follow to get to your expected results?
CREATE TABLE News(
NewId bigint identity ,
...
June 4, 2014 at 2:31 pm
Can you explain how do you get to that result?
June 4, 2014 at 2:22 pm
Why are you joining all three tables if you only use tables from News?
Could you post sample data and expected results? preferably in the form of INSERT statements.
Here's how you're...
June 4, 2014 at 1:14 pm
dquirion78 (6/4/2014)
ReallySo I probably need a new stored procedure !
Maybe a new database or a new server. :hehe:
We can't see what's going on, so we can't really help.
June 4, 2014 at 12:02 pm
A stored procedure (yours) can call another stored procedure (sp_executesql) without a problem.
Do you want to insert the results on a temp table? That would cause more difficulties but it...
June 4, 2014 at 11:50 am
Viewing 15 posts - 6,331 through 6,345 (of 8,731 total)