How to write the Query

  • Hi,

    I have a table with the following data structure-

    IDF1F2F3

    11nullnull

    1null1null

    1nullnull1

    I want to get the result in the following way -

    IDF1F2F3

    1111

    how can I write the Query?

    Any kind of help is appreciated.

    Thanks in advance.

    Maks............

  • h_maksuda (6/12/2012)


    Hi,

    I have a table with the following data structure-

    IDF1F2F3

    11nullnull

    1null1null

    1nullnull1

    I want to get the result in the following way -

    IDF1F2F3

    1111

    how can I write the Query?

    Any kind of help is appreciated.

    Thanks in advance.

    Maks............

    Like this maybe? You'll have to test it.

    select ID, max(F1), MAX(F2), MAX(F3)

    from dbo.MyTable

    group by ID

    order by ID;

  • Hi All,

    I have used sys.dm_exec_query_stats and sys.sysprocesses to find long running queries particulary more than 60 minutes. But, as am not gud at sql scripting not able to join these two dmv's that would give results with database name, host name, spid ,user name , elasped time taken in minutes and sql text. Also, it should automatically kill queries that are running more than 60 minutes.

    Group: Awaiting for any response as early as possible.!

    Thanks.!

  • glamourth (6/13/2012)


    Hi All,

    I have used sys.dm_exec_query_stats and sys.sysprocesses to find long running queries particulary more than 60 minutes. But, as am not gud at sql scripting not able to join these two dmv's that would give results with database name, host name, spid ,user name , elasped time taken in minutes and sql text. Also, it should automatically kill queries that are running more than 60 minutes.

    Group: Awaiting for any response as early as possible.!

    Thanks.!

    You really should start your own thread for new questions like this one.

  • Thanks Lynn Pettis. I think it's working....

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply