Viewing 15 posts - 151 through 165 (of 898 total)
Ananth@Sql (6/18/2013)
the table and what are the columns getting used is it...
June 18, 2013 at 4:05 am
No. The performance will remain the same as SQL Server will break the query into individual parts before executing.
If the view in indexed, you might see performance benefit as the...
June 18, 2013 at 4:02 am
This should give you some idea
SELECTSno,
MAX( CASE WHEN RN = 1 THEN Sname ELSE NULL END ) AS Name1,
MAX( CASE WHEN RN = 2 THEN Sname ELSE NULL END )...
June 18, 2013 at 2:39 am
You have probably interchanged the order of columns in your SELECT statement
INSERT INTO @ResultTable (curRN, prevRN, curBid, prevBid, Item, Concat)
SELECT cur.RN AS 'Cur-RN', prev.RN AS 'Prev-RN', cur.Bid AS 'Cur-Bid', prev.Bid...
June 18, 2013 at 2:13 am
Something like this
WITH cteexp(q, col) AS
(
SELECTCAST(1 AS INT) p,
CAST( 'X' AS NVARCHAR(100) )AS col
UNION ALL
...
June 18, 2013 at 1:31 am
GPO (6/17/2013)
June 18, 2013 at 1:19 am
There are 2 ways to do this
SELECTCONVERT(NUMERIC(17,2),REPLACE(REPLACE(data,',',''),'$',''))
FROMdataconvert
SELECTCONVERT(MONEY,REPLACE(data,',',''))
FROMdataconvert
June 17, 2013 at 4:57 am
vignesh.ms (6/16/2013)
Works fine but im a newbie to SQL ...Please explain how it works....
The explanation is present in the link I had provided earlier. I will add it once again...
June 16, 2013 at 9:29 am
WITH CTE AS
(
SELECT DISTINCT
Category
FROM Sampletable
)
SELECT Category,
Organisams = STUFF((
...
June 16, 2013 at 9:15 am
Duplicate post. Please direct all your replies here
http://www.sqlservercentral.com/Forums/Topic1463838-391-1.aspx
June 16, 2013 at 8:49 am
One simple way would be the following steps:
1. Run the SELECT query in your SSMS( SELECT * FROM YourTableName )
2. In the Results tab, you can select all the grid...
June 16, 2013 at 8:46 am
Something like this..
SELECT L_Limit,
U_Limit,
SUM(CASE
...
June 16, 2013 at 8:26 am
Hope this helps..
DECLARE @tbl_transaction TABLE
(
MemberIDINT,
CustomerVARCHAR(100),
TransactionDate DATETIME
)
INSERT@tbl_transaction
SELECT1, 'Cust1', '2013-01-01 00:00:00.000' UNION ALL
SELECT1, 'Cust1', '2013-03-01 00:00:00.000' UNION ALL
SELECT1, 'Cust1', '2013-02-01 00:00:00.000' UNION ALL
SELECT1, 'Cust1', '2013-05-01 00:00:00.000' UNION ALL
SELECT1, 'Cust1', '2013-06-01 00:00:00.000' UNION...
June 14, 2013 at 5:24 am
You will have to use ROW_NUMBER() to do this easily
If you could provide DDL of the tables involved, some sample data and the expected result, we can come up with...
June 14, 2013 at 4:53 am
Please post the table structure along with the indexes.
Have you tried creating an index on your "time stamp" column?
June 14, 2013 at 3:50 am
Viewing 15 posts - 151 through 165 (of 898 total)