Viewing 15 posts - 3,451 through 3,465 (of 4,087 total)
ChrisM@Work (12/6/2011)
December 6, 2011 at 8:08 am
ChrisM@Work (12/6/2011)
drew.allen (12/5/2011)
ChrisM@Work (12/5/2011)
December 6, 2011 at 7:12 am
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...
December 5, 2011 at 2:53 pm
ChrisM@Work (12/5/2011)
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...
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...
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)...
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...
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...
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,...
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?...
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...
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...
November 30, 2011 at 9:57 am
The Dixie Flatline (11/29/2011)
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...
November 29, 2011 at 9:26 am
Viewing 15 posts - 3,451 through 3,465 (of 4,087 total)