Viewing 15 posts - 511 through 525 (of 2,007 total)
Hey,
could you read this article[/url], then set-up the DDL and sample data in this format please? Then include the expected results based on your sample data.
Thanks 😀
August 31, 2012 at 4:42 am
I generally use this query as a first step in determining missing indexes.
DECLARE @DBName VARCHAR(50) = 'yourDB';
SELECT [Total Cost] = ROUND(avg_total_user_cost * avg_user_impact * (user_seeks + user_scans), 0),
avg_user_impact, TableName...
August 29, 2012 at 7:37 am
jdnelson.web (8/24/2012)
1. How would...
August 24, 2012 at 7:32 am
ganeshkumar005 (8/24/2012)
StudIDRollNo
AlphaD1234
betaA1122
charlieD1234
bravoC1342
tomB1964
harryA1122
and table B:
RollNoSubjectCode
D12341001
A11224001
D12342001
C13425001
B19646001
A11223001
I want to join the table A and B. For studID Alpha from table A i want the subjectcode 1001 only from table...
August 24, 2012 at 7:29 am
--== CREATE SAMPLE DATA (your should've included this in your post) ==--
-- Note, because you have written your "date" in the format you have, I've assumed
-- it is a VARCHAR...
August 23, 2012 at 9:00 am
tshad (8/23/2012)
I was trying to figure out how to get your way to work with a middle table and couldn't get it to work.
You're...
August 23, 2012 at 2:40 am
The same way we've already explained.
SELECT *
FROM (SELECT DealerID, DealerCode, DealerName, ForecastId, Name
FROM Dealers d
CROSS JOIN Forecast f)...
August 23, 2012 at 1:29 am
Phil Parkin (8/22/2012)
August 22, 2012 at 9:20 am
ChrisM@Work (8/22/2012)
SELECTStringy,
Stuffy = STUFF(STUFF(STUFF(Stringy,x3.startpos+1,x3.endpos-x3.startpos-1,'n'),x2.startpos+1,x2.endpos-x2.startpos-1,'n'),x1.startpos+1,x1.endpos-x1.startpos-1,'n')
FROM (SELECT Stringy = 'A1(1).B22(10).C345(100)') d
CROSS APPLY (SELECT startpos = CHARINDEX('(',Stringy,1), endpos = CHARINDEX(').',Stringy+'.',1)) x1
CROSS APPLY (SELECT startpos = CHARINDEX('(',Stringy,x1.startpos+1), endpos = CHARINDEX(').',Stringy+'.',x1.endpos+1)) x2
CROSS APPLY...
August 22, 2012 at 8:04 am
DECLARE @str VARCHAR(256) = 'A1(1).B22(10).C345(100)';
WITH CTE(N) AS (SELECT 1 UNION ALL SELECT 1),
CTE2(N) AS (SELECT 1 FROM CTE x, CTE y),
CTE3(N) AS (SELECT 1 FROM CTE2 x, CTE2 y),
CTE4(N) AS...
August 22, 2012 at 7:59 am
Phil Parkin (8/22/2012)
Is this homework? Interview questions? Because getting someone else to provide you with a solution is unlikely to help you learn.
Especially not that solution! :w00t:
Whoops? 😉
August 22, 2012 at 7:24 am
ssskumar4u (8/22/2012)
Thanks for your great help.
I observed that for this input :
@str = 'A1(1).B2(2)'
output from your code : Ann).Bnn)
Desired output : A1(n).B2(n)
String manipulation shoud effect only the numbers...
August 22, 2012 at 7:16 am
ssskumar4u (8/22/2012)
I have to peform a string manipulation as below:
Input: A(1).B(23).C(456)
Expected output : 1.23.456 ( need to append '.' for each substring)
Current output with below code : ...
August 22, 2012 at 7:10 am
Different approach: -
DECLARE @str VARCHAR(256);
SET @str = 'A(1).BC(10).DEF(100)';
WITH CTE(N) AS (SELECT 1 UNION ALL SELECT 1),
CTE2(N) AS (SELECT 1 FROM CTE x, CTE y),
CTE3(N) AS (SELECT 1 FROM CTE2 x,...
August 22, 2012 at 6:49 am
rajemessage (8/22/2012)
Entry can be done in from lenght and to lenght like following.
900000.0001,900000.0005 so there is gap of .0004.
starting from .0001 to .0005...
August 22, 2012 at 5:22 am
Viewing 15 posts - 511 through 525 (of 2,007 total)