Forum Replies Created

Viewing 15 posts - 8,626 through 8,640 (of 10,144 total)

  • RE: SELECT DISTINCT TOP 1

    Carolyn's got it on the nose. There are two dupe pairs (on capacity, secy_type and record_type) in the sample data:

    SELECT '12345678', 'B', '1234', '1', '3A', 'A' UNION ALL --

    SELECT...

  • RE: Updating one table with records from another

    Something like this should do the trick, Joseph:

    INSERT INTO TableB ([column list])

    SELECT ([matching column list from TableA] including GETDATE() AS DateUpdated)

    FROM TableA a

    LEFT JOIN TableB b

    ON b.[four digit...

  • RE: Grouping

    Mark beat me to it - but here's a slightly different way:

    -- make some sample data

    DROP TABLE #sales

    CREATE TABLE #sales (productname VARCHAR(20), turnover MONEY)

    INSERT INTO #sales (productname, turnover)

    SELECT 'redwine', 40...

  • RE: Sort by Question

    Is this what you're looking for?

    -- make up some sample data

    DROP TABLE #tbl_Listings

    CREATE TABLE #tbl_Listings (Location VARCHAR(20), Price MONEY)

    INSERT INTO #tbl_Listings (Location, Price)

    SELECT 'RM10', 100000 UNION ALL

    SELECT 'RM20', 200000 UNION...

  • RE: how to convert a bigint value to datetime

    bhuwnesh.kumar (3/27/2009)


    In a table, datetime is stored in a column with type bigint. Values stored in this column are of 13 digits.

    How these values can be converted to simple...

  • RE: T-Sql rant

    foxjazz (3/26/2009)


    Have any of you seen the challace and viewed another way it looks like a face?

    Or a cube drawn on paper, and how the perspective can change.

    I liken doing...

  • RE: Starttime of the next row have to be the endtime of the previous row.....

    Blimey Gus, just as a matter of interest (and on a hunch after reading something Gail wrote some time ago) I set this up with a correlated subquery to compare...

  • RE: Are the posted questions getting worse?

    Luke L (3/26/2009)


    Best part is one of the local wineries grow radioactive grapes for their wines, or so the story goes... Never tested it to see if it really glows...

  • RE: Are the posted questions getting worse?

    Grant Fritchey (3/26/2009)


    Besides, I've operated nuclear power plants while inebriated (not my fault, my chief liked drinking partners) and nothing happened.

    If anybody wants to know what Grant looked like...

  • RE: Long running queries when using DISTINCT with Strings

    Here's some sample data:

    DROP TABLE #Question

    CREATE TABLE #Question(

    [ID] [bigint],

    [UserID] [bigint] NULL,

    [VisitorID] [bigint] NULL,

    [Text] [varchar](20) NULL,

    [TimeStamp] [datetime] NOT NULL,

    [ViewCount] [bigint] NOT NULL,

    [MetaKeywords] [nvarchar](50) NULL,

    [MetaDescription] [nvarchar](50) NULL,

    [PageURL] [nvarchar](50) NULL,

    [CategoryID] [bigint] NULL,

    [LocationID]...

  • RE: Long running queries when using DISTINCT with Strings

    sorry I am unable to get your point please explain again !

    Check the [ID] column in your table. Is it unique or does it have duplicates?

  • RE: Are the posted questions getting worse?

    Roy Ernest (3/26/2009)


    Sure, No problem..

    Just hop over on the next plane to Curacao. You can lie down on the beach and drink what ever you want. I will take care...

  • RE: Long running queries when using DISTINCT with Strings

    Can you run this query and post the results, please? You may wish to change sensitive data but if you do, please explain exactly which columns have been changed.

    SELECT TOP...

  • RE: Long running queries when using DISTINCT with Strings

    musab (3/26/2009)


    Column1 is the Text Column

    Column2 is the Source Column

    I need to concatinate both the columns and then need to Remove the duplicates

    The rows are complete duplicates all the data...

  • RE: Long running queries when using DISTINCT with Strings

    musab (3/26/2009)


    The Column1 i.e. Text contains questions and I need to find unique questions and there are different questions in it and duplicates as well so I just need to...

Viewing 15 posts - 8,626 through 8,640 (of 10,144 total)