Viewing 15 posts - 4,261 through 4,275 (of 10,144 total)
July 30, 2013 at 4:44 am
Hi Charlotte
Some sample data in the same format as you provided in this thread would help. Thanks.
July 30, 2013 at 4:41 am
Do you have to read the same table three times or would something like this work?
SELECT EditionID, Make, Model, EditionDesc, Value1
FROM t1
HAVING Value1 BETWEEN
(CASE WHEN Value1 <= @trig
THEN TRUNCATE(Value1-@tol1,1)...
July 30, 2013 at 4:37 am
There is a cheaty way to use a side-effecting function in a function, and that's to encapsulate it into a view, like this:
CREATE VIEW vw_srn AS SELECT srn = ABS(CHECKSUM(NEWID()))
GO
CREATE...
July 30, 2013 at 3:55 am
Use APPLY with a simple expression like this. Also, RAND operates as a run-time constant. NEWID doesn't, so you can generate a new value for each output row of your...
July 30, 2013 at 3:49 am
Peter Brinkhaus (7/29/2013)
mister.magoo (7/29/2013)
Of course, I could be wrong and will skulk away with my tail between my legs when Paul tells me I am wrong 😛
I guess Paul will...
July 30, 2013 at 1:20 am
SQL_Surfer (7/29/2013)
Where are you doing SELECT @Var5 = max(mycol) FROM Mytable WHERE mycol = @a ? I need to get max on that column from Mytable.
You can't get...
July 30, 2013 at 1:04 am
N.D (7/29/2013)
July 30, 2013 at 12:52 am
There's an extra column in your output. You can filter on it, provided you set up the query as an inner query or CTE of an outer query wielding the...
July 29, 2013 at 9:38 am
Blimey MM if I was a snake oil brewer I'd want you leading my sales force! Whether you're on the right track or not, it's a great story!
Have a look...
July 29, 2013 at 9:37 am
select
backup_start_date as [Date],
((f.backup_size/1024)/1024) as [Database Size],
((f.file_size/1024)/1024) as [File Size],
RANK() OVER (PARTITION BY backup_start_date ORDER BY backup_start_date) AS Rank,
rn = ROW_NUMBER() OVER (PARTITION BY MONTH(backup_start_date) ORDER BY backup_start_date DESC)
from...
July 29, 2013 at 8:55 am
ssskumar4u (7/29/2013)
Thanks for your response.
It is the case that based on pattern matching, we have to retrieve the index number.
If pattern matching fails,then identify the error record...
July 29, 2013 at 8:47 am
margarett.hance 40946 (7/29/2013)
select * from data where Desc like '%CA%'
The OP is now selling real estate in Argentina, 3 1/2 years later.
Margarett, if the leftmost part of the Desc column...
July 29, 2013 at 8:32 am
-- Stare & Compare: check it's likely to work
;WITH Updater AS (
SELECT *, rn = ROW_NUMBER() OVER(PARTITION BY category ORDER BY creation_date DESC)
FROM MyTable
)
SELECT *
FROM Updater
WHERE rn > 2
--...
July 29, 2013 at 8:16 am
Sean, there are more details here.
July 29, 2013 at 7:43 am
Viewing 15 posts - 4,261 through 4,275 (of 10,144 total)