Viewing 15 posts - 151 through 165 (of 462 total)
Select LEFT(RIGHT(convert(varchar(20), getdate(), 100), 7), 5) + ' ' +
RIGHT(convert(varchar(20), getdate(), 100), 2)
December 1, 2009 at 6:21 am
Not sure if you are understanding the gravity of the situation or I am not understanding your requirement.
If its time, you cant put it in varchar data type and...
December 1, 2009 at 5:09 am
You mean this?
DEclare @name varchar(10),
@Class varchar(10),
@rNo int,
@Section varchar(10),
@Address varchar(50)
SET @NAME = 'Gaurav'
SET @Class = 'Tenth'
SET @rNo = 100
SET @Section = 'A'
SET @Address = @name + char(13) +...
November 30, 2009 at 4:45 am
amitsingh308 (11/30/2009)
November 30, 2009 at 4:30 am
sherifffruitfly (11/27/2009)
Besides the technical...
November 28, 2009 at 12:49 am
TheSQLGuru (11/27/2009)
using ROW_NUMBER is the classic way of finding/deleting dupes. Most do it with a CTE as the driver, which can be a bit easier for some to grok.
True....
November 27, 2009 at 9:36 am
Paul_Harvey (11/27/2009)
That was my first attempt at helping someone...
Your attempt was somewhat more sophisticated though.
It would be nice to know whether it has solved the problem or not..
🙂
<Edited:...
November 27, 2009 at 9:28 am
Jeff Moden (11/26/2009)
Heh... now I see it... the OP snuck it into code. Nothing like a little hidden "added scope", huh? 😛
It was hidden indeed 😀
Sorry PrevFlag ...
November 26, 2009 at 12:49 pm
oops.. what an 'RBAR' my query was!
This one is nice, thanks Jeff.
OP wanted a case
Case 3
-------
a.In the first record itself C1 == C2 i.e equal then keep 0...
November 26, 2009 at 7:55 am
2005 version:
Create table #t(IID int, INAME varchar(10), PRICE int)
delete from #t
INSERT INTO #t VALUES (1, 'alo', 34)
INSERT INTO #t VALUES (2, 'dhi', 48)
INSERT INTO #t VALUES (3, 'banana', 68)
INSERT INTO...
November 26, 2009 at 5:53 am
Jeff Moden (11/25/2009)
Heh... just a "forum, survival tip"... I wouldn't make any such performance claims unless I had code to back it up. I've been burned without the code.
:-)...
November 26, 2009 at 3:54 am
Select convert(varchar(10), CONVERT(datetime, getdate(), 101), 103)
November 25, 2009 at 2:59 am
Ok, with lot of assumptions. Here you go. Is this what you need?
;with CTE (c1,c2, row_num) as
(select c1,c2, row_number() OVER (order by C1) as row_num from
#test1)
Select C1,C2,
CASE...
November 25, 2009 at 1:14 am
Viewing 15 posts - 151 through 165 (of 462 total)