Viewing 15 posts - 8,581 through 8,595 (of 8,730 total)
Would this work?
However, my guess is that it would perform really bad.
SELECT *
FROM @Codes
WHERE code LIKE 'ABCD%'
AND PATINDEX( '%[^0-9]%', REPLACE( code, 'ABCD', '' )) = 0
EDIT: Never mind, stay with...
August 16, 2012 at 9:44 am
I might be wrong and probably shouldn't give a solution with such few information. If you could provide DDL and sample data, I could test it.
This should work if your...
August 16, 2012 at 7:28 am
Apart from Lynn recommendation, you don't need to add "ISNULL(Warranty,'0')" if you have "WHERE (Warranty IS NOT NULL)".
This won't solve your problem (in the article they show your possible solution)...
August 15, 2012 at 2:03 pm
Jared,
The order should be determined by UnitsInStock for each CategoryID, unless there is a zero for any value in UnitsInStock for that particular CategoryID, the order should be determined...
August 15, 2012 at 12:43 pm
Amy.G (8/15/2012)
Luis, You make my query look like a school kid's art project. How do you think up that kind of thing? Thank you!
hahaha Thank you Amy, you...
August 15, 2012 at 12:32 pm
I'm not sure if this will give a good performance. Maybe someone else will come with a better idea.
SELECT [CategoryID]
,[UnitPrice]
,[UnitsInStock]
,ROW_NUMBER() over (partition by categoryid
order by CASE when 0 IN...
August 15, 2012 at 12:05 pm
Do ISO standards say anything about:
- writing readable code?
- writing code according to the software's version used?
- reading previous comments?
- be aware of the requirements in...
August 15, 2012 at 9:58 am
I agree with you Cadavre, but I realized that after posting and realizing the OP was saying devices instead of ids. I corrected it before I saw your new post.
August 15, 2012 at 8:49 am
This has been solved in other posts and seems to be a very common issue.
Here's one solution (I added DDL and sample data in an usable format and you should...
August 15, 2012 at 8:36 am
Have you used one of the solutions we gave you?
Lowell's might return duplicate rows (because of the extra inner join), but Chris' and mine should not have that problem.
Could...
August 15, 2012 at 7:33 am
Have you read this?
August 14, 2012 at 2:34 pm
I might have answered too quickly and missed some points.
SQL Server doesn't manage arrays, just sets of data (tables or results from queries).
SQL Server won't allow you to assign several...
August 14, 2012 at 1:45 pm
No, but it's possible to do it this way.
DECLARE @Exam table( exam nvarchar(100))
INSERT INTO @Exam
SELECT 'DMDCUMGP' UNION ALL
SELECT 'DMDSCIGP' UNION ALL
SELECT 'DATACAVG' UNION ALL
SELECT 'DATPERAB'
SELECT *
FROM
WHERE
.Exam IN...
August 14, 2012 at 1:35 pm
Sorry, I've just noticed that you asked for dot separators not commas
Wouldn't this be defined by the regional settings? If the settings affect the format for money, this can result...
August 14, 2012 at 12:05 pm
I'm not sure if it will solve the problem without having DDL and sample data to test on.
My suggestion is to move the condition from the WHERE clause to the...
August 14, 2012 at 10:05 am
Viewing 15 posts - 8,581 through 8,595 (of 8,730 total)