SQL drop


    DROP TABLE IF EXISTS OARD, and a correlated subquery with a grouping that would give the total of adding all the null and blank votes, but I'm a bit lost. Thanks for the help!
  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • I'm not sure what you mean. You're saying you want to drop the table if it exists AND some additional criteria? DROP only uses IF EXISTS. There's not a way, within the DROP statement itself, to add more criteria. So, step back, make an IF statement that matches the additional criteria, then, if that passes, go to the DROP IF EXISTS.

    The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore Roosevelt
    The Scary DBA
    Author of: SQL Server 2022 Query Performance Tuning, 6th Edition and SQL Server Execution Plans, 3rd Edition
    Product Evangelist for Red Gate Software

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

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