Create and use temporary INDEX

  • Ok !!!

    I understnad....or i change situation creating one new table...or i use "Select count(*)" and wait

    right ?

  • Like Matt, I would not do a Select Count(*). If you're only looking for the existence of the records instead of caring about how many records there actually are, use his code instead. It's much easier.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Alberto, is there anyone in your office wearing a blue shirt?

    When you answer this, do you count all the people who are wearing blue shirts before answering yes or no. Or do you see just one person wearing a blue shirt and answer yes. Which is quicker for you to do?

    The query you are describing in your postings seems to be counting the total number of blue shirts just to decide if at least one person has a blue shirt.

    Take another look at the previous posts in this thread. If your query just needs to know a true or false answer, look at the suggestion on how to make this work.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

  • Ed,

    That is an *excellent* way of rephrasing the question! Thanks for that. @=)

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Thank you very much Ed !

    Good answer !!!

    I open my eyes !!!!!!!!

    thank you for all your support !

    bye

    Alberto.

Viewing 5 posts - 16 through 19 (of 19 total)

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