Viewing 15 posts - 8,866 through 8,880 (of 15,381 total)
MackF (3/29/2013)
CREATE FUNCTION fnSplitString(@str nvarchar(max),@sep nvarchar(max))
RETURNS TABLE
AS
RETURN
WITH a AS(
SELECT CAST(0 AS BIGINT) as idx1,CHARINDEX(@sep,@str) idx2
UNION ALL
SELECT idx2+1,CHARINDEX(@sep,@str,idx2+1)
FROM a
WHERE idx2>0
)
SELECT SUBSTRING(@str,idx1,COALESCE(NULLIF(idx2,0),LEN(@str)+1)-idx1) as value
FROM a
Execution is more...
March 29, 2013 at 7:38 am
mrivero1961 (3/28/2013)
Sean Lange (3/28/2013)
I really can't tell from what you have posted what the...
March 28, 2013 at 3:12 pm
kk1173 (3/28/2013)
Full Index search will need an index on the view.And Indexed view will not be a good idea here since the data in case1 table is frequently updated.
Then you...
March 28, 2013 at 3:01 pm
This is MySql. If you want to join multiple queries together you probably need to use UNION.
I really can't tell from what you have posted what the actual issue is...
March 28, 2013 at 2:32 pm
mrivero1961 (3/28/2013)
I've modified the query, but the output not change:
SELECT
DATE_START,
COALESCE (idDGIG, 'Tot') AS sGIG,
`NUMBER`
FROM
(
SELECT
CA.DATE_START AS DATE_START,
LEFT (CA.idDGIG, 2) AS sGIG,
COUNT(CA.idDGIG) + COUNT(A.EVENT) AS NUMBER
FROM
TABLE_LONG CA
JOIN TABLE_SHORT...
March 28, 2013 at 2:28 pm
kk1173 (3/28/2013)
For e.g.
select * from Myview where display like '%aarp%'
returns 26706 rows in 51...
March 28, 2013 at 2:25 pm
texpic (3/28/2013)
If I do not have a join, I can do a query like this:
SELECT * FROM...
March 28, 2013 at 2:19 pm
The queries you posted have some stuff missing.
In all cases you don't need to get the left 2 characters and then use like '%%'. The left can't possibly return anymore...
March 28, 2013 at 2:16 pm
Check out this article from Gail. http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/%5B/url%5D
March 28, 2013 at 1:54 pm
kk1173 (3/28/2013)
Wildcard search needs to be done. If I do a value% it will do BeginWith.
Then performance is never going to be very good for this. This is looking through...
March 28, 2013 at 1:50 pm
Actually I can read java without much effort.
Honestly I don't think converting this to straight t-sql is feasible in an online forum.
There are least a dozen methods that have not...
March 28, 2013 at 1:48 pm
Code-1029433 (3/28/2013)
March 28, 2013 at 12:50 pm
Brandie Tarvin (3/28/2013)
Sean Lange (3/28/2013)
kk1173 (3/28/2013)
discharged_entered is a date field.Then forget all the convert nonsense. Just compare it to a datetime.
c.discharge_entered_dt >= DATEADD(DAY, -14, getdate())
Sean, This won't necessarily work for...
March 28, 2013 at 12:46 pm
You can certainly come up with something that will not be so ugly. However it is not possible for anybody to offer much more than vague ideas at this point...
March 28, 2013 at 12:41 pm
Brandie Tarvin (3/28/2013)
Also, your WHERE clause is potentially processing that CONVERT on a row-by-row basis (ouch!) to compare it to the column.
Actually this won't run it for every row. The...
March 28, 2013 at 12:38 pm
Viewing 15 posts - 8,866 through 8,880 (of 15,381 total)