Forum Replies Created

Viewing 15 posts - 871 through 885 (of 1,183 total)

  • RE: Union Query in Reverse

    Select ident_type_id as Form1_IDs

    from form_ident_types

    where b.form_id = 1

    and ident_type_id NOT IN (

    Select ident_type_id

    from form_ident_types

    where form_id = 7)

  • RE: Reporting Services: great difference in report execution time versus the query execution time ?

    That depends. Are you doing a lot of grouping or aggregating in the report? Do as much as possible in the code as the report server isn't nearly as efficient...

  • RE: Xml Query

    Hmmmm. I guess you can't post XML here...

    STEVE :exclamation: !!!!!

  • RE: Xml Query

    Place your XML within "[cod e]" and "[/cod e]" tags and remove the space from the word code.

  • RE: complex select problem w history tables, date ranges

    I too would like to know how you keep your formatting!!!:D

  • RE: Sql Problem

    OK, well then I may not be going nuts.... :hehe:

  • RE: Sql Problem

    Isn't that what DISTINCT means?

    If you have a set of 1,1,1,2,3,3,3,4 are the DISTINCT numbers not 1,2,3, and 4?

  • RE: Sql Problem

    Peter, forgive me here (bold is only being used for clarity, not yelling). But ...

    given the table ....

    CREATE TABLE #temp

    (Id int,

    tname varchar(10),

    Email varchar(10),

    Age int,

    Salary int)

    INSERT INTO #temp

    SELECT '1','aaa','1@abc.com',20,1000

    UNION

    SELECT '2','aaa','1@abc.com',20,1000

    UNION

    SELECT '3','aaa','2@abc.com',20,1000

    UNION...

  • RE: Sql Problem

    No, the count(*) will give you the count of records in that group, not an incremental row number....

    Run your script and you'll see... *grin* :hehe:

  • RE: Help with T-SQL Syntax

    Yes' it's a pitty there's no F7 in SMS...;)

  • RE: Sql Problem

    You want row_number() not count(*) ....

    CREATE TABLE #temp

    (

    Id int,

    tname varchar(10),

    Email varchar(10),

    Age int,

    Salary int

    )

    INSERT INTO #temp

    SELECT '1','aaa','1@abc.com',20,1000

    UNION

    SELECT '2','aaa','1@abc.com',20,1000

    UNION

    SELECT '3','bbb','1@abc.com',20,1000

    SELECT ID, tName, Email, Age, Salary, recID

    FROM( SELECT ID, tName, Email, Age, Salary,

    ROW_NUMBER()...

  • RE: Date Question

    Sorry, but that just confused me even more...:w00t:

  • RE: Sql Problem

    Can you provide the DDL (definition) for your table. What fields does it contain? Which two fields are required to be "distinct" in your result set?

  • RE: select statement

    Thanks Steve. FYI, I didn't mean the "first" physical record, rather the first record in terms of datetime.

    But anywho, thanks for the better solution Steve.

  • RE: select statement

    This solution is taking so many assumptions, it's not funny... but this works

    with the assumptions that

    1. the start date is the first entry in the table.

    2. a phone number...

Viewing 15 posts - 871 through 885 (of 1,183 total)