Viewing 15 posts - 1,366 through 1,380 (of 3,957 total)
Mark-101232 (10/1/2013)
dwain.c (9/30/2013)
Mark-101232 (9/30/2013)
WITH CategoriesWanted([Category]) AS (
SELECT [Category]
FROM ( VALUES (3),(6)) x([Category])
)
SELECT [Project]
FROM [dbo].[Project_Category]
WHERE [Category] IN (SELECT [Category] FROM CategoriesWanted)
GROUP BY...
October 1, 2013 at 9:14 pm
To add onto Luis's suggestion:
WITH SampleData AS (
SELECT test = 'my email is Test@email.com.au how do i capture just the email' UNION ALL
SELECT 'Some invalid@email addresses can also be removed...
October 1, 2013 at 6:50 pm
Perhaps like this?
with t as (
select 100 pk, 1 level, 'Alpha' c1, 'ID101' c2 union
select 100 pk, 2 level,...
October 1, 2013 at 6:36 pm
There's about a 50-50 chance that this article may give you some ideas how you could do this:
October 1, 2013 at 6:10 pm
SELECT CAST(N'15 Jul 2013' AS DATE)
October 1, 2013 at 6:07 pm
<Ctrl-Alt-Delete>US Federal Government</Ctrl-Alt-Delete>
Could be the best thing to happen in years.
Living in Thailand, I'm hoping our government follows suit.
October 1, 2013 at 5:54 pm
SQL_FS (10/1/2013)
Sean Lange (10/1/2013)
SQL_FS (9/30/2013)
SELECT string, categoryFROM @SampleData
ORDER BY
CASE WHEN category % 7 = 0 THEN 1
WHEN category % 3 = 0 THEN 2
ELSE 3
END ASC
, string ASC
This is NOT...
October 1, 2013 at 5:49 pm
T.Ashish (9/30/2013)
You add a column somewhere in the start or middle or your table and all ordinals will be changed. Now you have to correct all of your queries.
I believe...
September 30, 2013 at 10:57 pm
If that still wasn't fast enough, this one should blow the doors off of both.
SELECT a.[Contract], a.AdmissionDate, Cost=SumofCost, Members=CountofMembers
,SumofCost=CAST(0.0 AS DECIMAL(19,4))
,CountofMembers=0
...
September 30, 2013 at 8:31 pm
In the meantime, you could also try this version, which provides a slightly different but possibly useable result also.
WITH MyData AS
(
SELECT a.[Contract], a.AdmissionDate, SumofCost, CountofMembers
...
September 30, 2013 at 7:36 pm
Mark-101232 (9/30/2013)
WITH CategoriesWanted([Category]) AS (
SELECT [Category]
FROM ( VALUES (3),(6)) x([Category])
)
SELECT [Project]
FROM [dbo].[Project_Category]
WHERE [Category] IN (SELECT [Category] FROM CategoriesWanted)
GROUP BY [Project]
HAVING COUNT(DISTINCT...
September 30, 2013 at 7:08 pm
I never use the column positional (I think it is called ordinal) as the SORT BY column.
I think it is much more clear to use the explicit column name, so...
September 30, 2013 at 7:06 pm
Briceston (9/30/2013)
I used your last code example in my environment, and it's taking long to execute. I keep having to cancel it at the 4min mark or...
September 30, 2013 at 6:09 pm
dc.pc100 (9/30/2013)
The "OR" x12 in the where clause it fine for now. Ill probs just...
September 30, 2013 at 12:24 am
This might work for a few more cases but no guarantee for all.
WITH SampleData (sourcedata) AS
(
SELECT '12 Jan 2013 Test.docx'
UNION ALL...
September 30, 2013 at 12:19 am
Viewing 15 posts - 1,366 through 1,380 (of 3,957 total)