Forum Replies Created

Viewing 15 posts - 286 through 300 (of 463 total)

  • RE: Query Help Please!

    winsysadmin (10/21/2009)


    I need to be able to query a database to find records that meet BOTH of the following conditions below:

    SELECT * FROM SoftwareProduct where Productname='Internet Information Services' and ProductVersion...

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

  • RE: a simple store procedure

    ur welcome 🙂

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

  • RE: Getting only the top number from a dataset

    Stephen crocker (10/21/2009)


    I have a query I need to build and am pulling my hair out over it.

    I have a table that has multiple records for each person in...

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

  • RE: a simple store procedure

    Remove the select part and just keep this in your sp

    update [File]

    set DownloadCount=DownloadCount+1

    Where FileCode = @FileCodesql

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

  • RE: Distinct selection on datetime

    Do you want to group it by sysuser and day?

    CREATE TABLE #T1(dt datetime, AT varchar(50), SysUser Varchar(50))

    INSERT INTO #T1 VALUES ('2006-08-21 08:25:04:633', 'SQLAgent', 'smithj')

    INSERT INTO #T1 VALUES ('2006-08-22 08:25:04:633', 'SQLAgent',...

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

  • RE: Help needed with joins in update trigger

    I love animals, so went an extra mile to provide the query 🙂

    But if you provide the test data like this, you would get quicker reply. Thanks.

    CREATE TABLE dbo.species(speciesID...

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

  • RE: Getting an "extra" field from the result of a GROUP BY

    oh thanks Seth, I was not completely sure about that. I had to use an aggregate function there and had chosen max.

    @Kramaswamy, sorry I was not 100% sure bout...

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

  • RE: Getting an "extra" field from the result of a GROUP BY

    Please look at the explanation by Seth below. Thanks.

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

  • RE: Getting an "extra" field from the result of a GROUP BY

    Will this do?

    SELECT [Date], SubjectLine, max(case when categoryID = 1 THen CONTENT END) as Content

    FROM #Temp

    GROUP BY [Date], SubjectLine

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

  • RE: Help with percentage

    declare a variable, get your total into that variable and then divide each column in the select with the variable something like this,

    Declare @max-2 as float

    Set @max-2 = 200...

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

  • RE: How to use group in query

    Yes, same as Steve (with some test data and summing)

    DRop table Manager

    CREATE TABLE MANAGER(id int, category varchar(50))

    INSERT INTO MANAGER VALUES(1,'Operations')

    INSERT INTO MANAGER VALUES(1,'Operations')

    INSERT INTO MANAGER VALUES(1,'Operations')

    INSERT INTO MANAGER VALUES(1,'Operations')

    INSERT INTO...

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

  • RE: sql server insert from different tables

    fuzzy528 (10/17/2009)


    Thanks a ton for your time brother !!

    Thats nice of you to say that 🙂 ur welcome.

    Getting the nickname is simple, join your profile_education table with profiles table...

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

  • RE: sql server insert from different tables

    fuzzy528 (10/16/2009)


    The same with the pivot solution...(also i would like to mention, i need to put the results into profiles_display not just show them)

    I dont think so!!! add this to...

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

  • RE: sql server insert from different tables

    PIVOT:

    Select profileID,

    [1] as Institution1,

    [2] as Institution2,

    [3] as Institution3,

    [4] as Institution4

    FROM (Select

    ProfileID, Institution, ROW_NUMBER()

    OVER (PARTITION BY PROFILEID ORDER BY ProfileID) as Row_no from

    profiles_education) as PE

    PIVOT (max(INSTITUTION) FOR...

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

  • RE: t-sql query urgent need help

    @paul-2,

    amazing!! this is an undocumented feature isn't it?:w00t: (%%lockres%% )

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

Viewing 15 posts - 286 through 300 (of 463 total)