Forum Replies Created

Viewing 15 posts - 166 through 180 (of 429 total)

  • RE: Identifying discrepancies

    You can identify the empids of the problem records, by grouping by empid and then counting distinct values of DOB.

    Something like this:

    SELECT

    EmpID

    FROM

    Emp

    WHERE

    EmpID IN ('12335', '23456', '545432','231245')

    GROUP BY...

  • RE: Updating Statistics

    OCTom (3/14/2014)


    Koen Verbeeck (3/14/2014)


    Richard Warr (3/14/2014)


    Stewart "Arturius" Campbell (3/14/2014)


    Interesting question, thanks Steve.

    Misread the question, thought it meant the highest level that a single command can be used...

    ah well...

    Same here :doze:

    +1

    Didn't...

  • RE: T-SQL SELECT..INTO

    Based on the answers, I'm guessing it was intended that the SELECT statement was a simple one containing only one table. If the query contained more than one table,...

  • RE: Order By Column

    Argh, you got me. Good question!

    Yet another reason to add to my list for always prefixing table names or aliases.

  • RE: Row level security

    You can still allow ad-hoc querying, if access is restricted to views that incorporate your row level access framework.

  • RE: Character Field Declaration

    The answer choices are a bit ambiguous I think.

    I ran it and it started snowing.

  • RE: Converting date to hour of the day

    SELECT DATEPART(hh, PDates) FROM #mydates

  • RE: Group Ranges First and Last values

    I see what you are doing now.

    Thanks both of you.

  • RE: Group Ranges First and Last values

    Sorry, I think I'm still missing something. :unsure:

    If they are contiguous groupings, shouldn't the first group in your test case for owner 22 be 4 A 5 A, since...

  • RE: Group Ranges First and Last values

    What are you grouping by, other than lot_OwnerID?

  • RE: So Simple, But Yet ....

    Your first query returns 0 rows because of the null email addresses in tableb.

    IN is essentially a shorthand for a series of equality clauses, so

    WHERE A NOT IN (1,2,3)

    becomes...

  • RE: Insert row with values from previous row if does not exist

    Like Sean said, there's no need to store the missing rows, since the query you use to generate them could be used to query the table. If you search...

  • RE: predict the output

    Good question!

    This little idiosyncrasy drove me nuts when I first ran into it.

  • RE: Central Management Server Security

    Argh, found information on the internet that is wrong!! Can you believe it? :crazy: :hehe:

  • RE: All the rows before this one

    LAG works for a fixed number of rows before the current row.

    For all the rows prior to the current row, wouldn't you use something like ROWS BETWEEN UNBOUNDED PRECEDING AND...

Viewing 15 posts - 166 through 180 (of 429 total)