qry options

  • I want to do this.

    select count(*) from

    (

    select col1,col2,......col18 from REVemployee.tbemp

    group by col1,col2,......col18 HAVING COUNT(*)>1

    )a

    is there a better way of doing the same for better proformance?

  • Tara-1044200 (6/11/2013)


    I want to do this.

    select count(*) from

    (

    select col1,col2,......col18 from REVemployee.tbemp

    group by col1,col2,......col18 HAVING COUNT(*)>1

    )a

    is there a better way of doing the same for better proformance?

    Looks fine to me. But you also can try this:

    select count(*) from

    (

    select null a from REVemployee.tbemp

    group by col1,col2,......col18 HAVING COUNT(*)>1

    )a

    You might have slightly better performance.

    You can also find duplicates using windowed function, but this very likely to be much slower.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

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