Forum Replies Created

Viewing 15 posts - 151 through 165 (of 463 total)

  • RE: Extracting Only Time From DateTime Field in a Certain Output Format

    Select LEFT(RIGHT(convert(varchar(20), getdate(), 100), 7), 5) + ' ' +

    RIGHT(convert(varchar(20), getdate(), 100), 2)

    ---------------------------------------------------------------------------------

  • RE: DateOf getdate()

    Select convert(varchar(10), getdate(), 103)

    ---------------------------------------------------------------------------------

  • RE: How to get True /False

    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...

    ---------------------------------------------------------------------------------

  • RE: Getting information in database in structured format

    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) +...

    ---------------------------------------------------------------------------------

  • RE: How to import data from excel file into mysql

    amitsingh308 (11/30/2009)


    hello sir actualy I am working on MySQL dbms. n I know in SQL Server we can import data from excel sheat. but someone told me we can do...

    ---------------------------------------------------------------------------------

  • RE: sp_help

    sp_help [owner.tablename]

    ---------------------------------------------------------------------------------

  • RE: how to delete the duplicate records from a table?

    sherifffruitfly (11/27/2009)


    I'm no sql genius or anything, but is anyone concerned that the poster apparently has 2+ versions of the truth running around in his or her database?

    Besides the technical...

    ---------------------------------------------------------------------------------

  • RE: how to delete the duplicate records from a table?

    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....

    ---------------------------------------------------------------------------------

  • RE: how to delete the duplicate records from a table?

    Paul_Harvey (11/27/2009)


    Nice work Nabha,

    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:...

    ---------------------------------------------------------------------------------

  • RE: Logic required for retaining previous value

    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 ...

    ---------------------------------------------------------------------------------

  • RE: Logic required for retaining previous value

    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...

    ---------------------------------------------------------------------------------

  • RE: how to delete the duplicate records from a table?

    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...

    ---------------------------------------------------------------------------------

  • RE: How can I find duplicate Entries in a table?

    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.

    :-)...

    ---------------------------------------------------------------------------------

  • RE: how to change date format in sql 2005 enterprise edition

    Select convert(varchar(10), CONVERT(datetime, getdate(), 101), 103)

    ---------------------------------------------------------------------------------

  • RE: Logic required for retaining previous value

    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...

    ---------------------------------------------------------------------------------

Viewing 15 posts - 151 through 165 (of 463 total)