Viewing 15 posts - 586 through 600 (of 692 total)
October 18, 2004 at 11:39 am
This will select maximum transaction amounts, including ties:
SELECT TransID, MemberID, DateOfTrans, Amount, TransType
FROM Transactions
WHERE Amount =
(SELECT MAX(Amount)
FROM Transactions T1
WHERE T1.MemberId =...
--
Adam Machanic
whoisactive
October 18, 2004 at 11:33 am
Actually, the answer would be: You wouldn't store delimited text in a column. ![]()
--
Adam Machanic
whoisactive
September 21, 2004 at 2:04 pm
There are more warnings to heed than just the 8000-character limit. Read this KB article before using this technique to avoid pitfalls:
http://support.microsoft.com/default.aspx?scid=kb;en-us;287515
--
Adam Machanic
whoisactive
September 21, 2004 at 7:29 am
"An index whose columns are used in the WHERE clause and also are the only columns returned in the SELECT clause."
Not quite. A better answer, IMO, would be: "A...
--
Adam Machanic
whoisactive
September 21, 2004 at 7:20 am
September 20, 2004 at 11:52 am
Melvin,
Where in the question did you see statement of which row was inserted first, last, or otherwise?
All you were given was the current state of the tables.
--
Adam Machanic
whoisactive
September 20, 2004 at 8:56 am
Mike,
This is not a trick question. This is a best practices issue and it brings to light problems with using T-SQL's proprietary syntax. As Lead Database Developer, you...
--
Adam Machanic
whoisactive
September 20, 2004 at 8:00 am
Chenthor,
You got a value of '2' for both UPDATEs in the script I provided?
--
Adam Machanic
whoisactive
September 20, 2004 at 7:47 am
Frank,
Did you run the script I posted? Paste it into Query Analyzer and run it.
--
Adam Machanic
whoisactive
September 20, 2004 at 7:26 am
This script proves things nicely:
CREATE TABLE #TestUpdateA
(ColA CHAR(1),
ColB INT)
GO
CREATE TABLE #TestUpdateB
(ColA CHAR(1),
ColB INT)
GO
INSERT #TestUpdateA (ColA, ColB)
VALUES ('A', 0)
INSERT #TestUpdateA (ColA, ColB)
VALUES ('B', 0)
INSERT #TestUpdateA (ColA, ColB)
VALUES ('C', 0)
GO
INSERT...
--
Adam Machanic
whoisactive
September 20, 2004 at 7:12 am
SELECT A.userId, B.jobId
FROM (SELECT DISTINCT userId FROM vwMatched) A
CROSS JOIN (SELECT DISTINCT jobId FROM vwMatched) B
WHERE NOT EXISTS
(SELECT *
FROM tblExclude
WHERE userId...
--
Adam Machanic
whoisactive
September 15, 2004 at 8:11 am
Wouldn't it be easier to just use:
SELECT RIGHT(RTRIM(Particulars), LEN(RTRIM(Particulars)) - CHARINDEX(';',Particulars) - 1)
FROM Sample_table
Also, you could remove the RTRIMs if you used VARCHAR instead of CHAR...
--
Adam Machanic
whoisactive
September 13, 2004 at 9:46 am
Why would you want to store blobs instead of normalized data?
Will you ever need to query the data, report on the data, or use the data for anything other than...
--
Adam Machanic
whoisactive
September 13, 2004 at 9:33 am
Can you expand upon your question a bit? What will be updated to a higher version? The DBMS, or the third party application itself? Did the vendor...
--
Adam Machanic
whoisactive
September 13, 2004 at 9:24 am
Viewing 15 posts - 586 through 600 (of 692 total)