Viewing 15 posts - 3,451 through 3,465 (of 4,085 total)
CELKO (12/5/2011)
Your approach to SQL is fundamentally wrong.
Your approach to SQL training is fundamentally wrong. Without specifics on what you think is fundamentally wrong, why you think it is...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 5, 2011 at 2:53 pm
ChrisM@Work (12/5/2011)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 5, 2011 at 11:30 am
aarionsql (12/5/2011)
HI Drew,can I have a join in a CASE statement?
No, but you can have a correlated subquery, a (NOT) IN with a subquery, or a (NOT) EXISTS with...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 5, 2011 at 10:00 am
aarionsql (12/5/2011)
Many thanks for your help. I should have mentioned I have gone down the route of CASE statements .. but there are far too many columns to look...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 5, 2011 at 9:14 am
Jim-720070 (12/5/2011)
How many fields do you need to look at? If there aren't too many you could use a CASE statement, given you work the logic out correctly:
SELECTEmp_No,
HR_ID,
CASE
WHEN LEN(Emp_No)...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 5, 2011 at 9:07 am
aarionsql (12/5/2011)
Many thanks for the code .. I am looking to loop as I will have a number of such columns and I will want to concatenate the error...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 5, 2011 at 9:04 am
It also helps to include expected results based on your sample data and what you have already tried. This looks fairly straightforward to me, so I must be misunderstanding...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 2, 2011 at 1:07 pm
CELKO (12/1/2011)
I am amazed at the dialect you got into one query! Here is how to actually write this in T-SQL using real ANSI SQL instead.
In case you hadn't noticed,...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 1, 2011 at 12:22 pm
kev43barrie (12/1/2011)
Ended up creating a function and calling the function in my select statement. Wasn't wanting to do that, but seems to be the best way.
Then why create one?...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 1, 2011 at 11:57 am
MyDoggieJessie (11/30/2011)
What is best to rewrite the below query instead of using temp table or cursors
Do you have specific concerns with using the temp tables? Or are you seeing...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 30, 2011 at 1:58 pm
It looks like you're going to need to use an aggregate function with windowing. The simplest case would be
CASE WHEN MAX(Status_ID) OVER( PARTITION BY Order_Number ) > 40 THEN...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 30, 2011 at 9:57 am
The Dixie Flatline (11/29/2011)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 29, 2011 at 2:57 pm
I've been thinking about this, but hadn't come up with a workable solution until now.
WITH Remaining_Prods AS (
SELECT p.ID
,p.[Name]
,Row_Number() OVER ( ORDER BY p.Sort ) AS Seq
FROM Prods AS p
LEFT...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 29, 2011 at 9:26 am
Use the '//' that you want to find all occurrences. Something like p.query_plan.nodes('//sp:RelOp/sp:OutputList/sp:ColumnReference')
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 29, 2011 at 7:13 am
mgoldade (11/28/2011)
However, the desire is that online courses print in ALL groupings AND as their own section for the students who only take courses online.
Remember that CASE is a "function"...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 28, 2011 at 8:44 am
Viewing 15 posts - 3,451 through 3,465 (of 4,085 total)