About 180,000 results
Open links in new tab
  1. sql standard - What actually is a SQL clause? - Database …

    To the question "What are sql clauses?" most of the resources on internet simply provide a list of clauses and explain what they do. But I'm trying to understand in abstract terms how it is …

  2. sql server - Merge two SELECT queries with different WHERE …

    Apr 19, 2014 · I have one table of services. I need to merge two SELECT queries. Both have different where clauses. For example SELECT U_REGN as 'Region', COUNT(callID) as …

  3. sql server - Window function in Update statement - Database ...

    Jul 24, 2019 · Is there a work around to use window functions in update statement You can populate sample/original table using the code Create table #table( key1 Char(5), date1 Date, …

  4. SQL Server - why are window functions not permitted in update ...

    Aug 2, 2016 · Window functions aren't permitted in UPDATE statements because UPDATE isn't compatible with SELECT or ORDER BY. Window functions are like scoped SELECT …

  5. Colleague says to never use an OR statement in SQL, is this true?

    Oct 16, 2020 · My colleague now responsible for SQL development says that I should never use an OR statement because it will mess up the query optimizer and ignore table indexes …

  6. Using column alias in a WHERE clause doesn't work

    Given a table users with two fields: id and email. select id, email as electronic_mail from ( select id, email from users ) t where electronic_mail = '' Postgres complains that:

  7. sql server - Error 4108: Windowed functions can only appear in the ...

    Aug 27, 2015 · Error 4108: Windowed functions can only appear in the SELECT or ORDER BY clauses Ask Question Asked 10 years, 3 months ago Modified 10 years, 3 months ago

  8. sql server - order of clauses in "EXISTS (...) OR EXISTS ...

    Apr 12, 2017 · (It also seems like if SQL Server were smarter, it would execute both EXISTS clauses in parallel and let whichever one one completed first short-circuit the other.) Is there a …

  9. sql server - Do you set an index on JOIN clauses or where clauses, …

    Do you set an index on JOIN clauses or where clauses, or both? Ask Question Asked 13 years, 5 months ago Modified 6 months ago

  10. Are WHERE clauses applied in the order they are written?

    Sep 22, 2015 · CTE terms (the clauses in a WITH query) are always executed in their entirety, if they're executed at all. They can't be flattened, and terms can't be pushed up or pulled down …