About 50 results
Open links in new tab
  1. How to use an expression like date_trunc () in GROUP BY?

    Aug 1, 2024 · Use table aliases to keep the noise level down. Table-qualify all columns in queries where conflicts or confusion might arise. timestamp::date is equivalent to date_trunc('day', timestamp) for …

  2. sql server - Truncate with where clause - Database Administrators Stack ...

    Apr 12, 2017 · Every SQL Developer wants full control over the Database by query. Due to which they start thinking beyond the SQL syntax. One such misconception is whether a where Clause be used …

  3. "truncate log on checkpoint" option in SQL Server

    In SQL Server 2000 and up, SQL Server has a concept of that defines how the log truncation is honored e.g. In simple recovery - only a checkpoint will truncate the log where as in full recovery mode - only …

  4. sql server - What is the idiomatic way to truncate a string down to 100 ...

    Depends on what part of the string you want truncated. You always want the first 100 byte pairs of the string (reading from left to right)?

  5. sql server - MS SQL full datetime to only month and date - Database ...

    Jan 1, 2016 · For best performance, use date/time arithmetic to truncate a datetime column to year and month before using it for grouping. There are at least two distinct approaches to that. Approach 1 …

  6. I want to get all the weeks of a month with the start and end dates of ...

    Jun 1, 2020 · The only "fly in the ointment" is the ',)' at the very end - the OP's requirement is for the string to end 2020-06-28) and not 2020-06-28,), so the very last part of the SQL statement is the use …

  7. oracle - Best way to get current year minus 5 years - Database ...

    Nov 17, 2017 · 3 I'm actually have the next query that I use to obtain the current year minus 5 years in january in this format 'YYYYMM'. select …

  8. What is the difference between these extracting date method?

    Jan 26, 2021 · Assuming I have a table called MyTable, with a TimeStamp field "Created". I want only extract the Date part of this column, and in my research I found these alternatives: …

  9. Oracle Query by Quarter - Database Administrators Stack Exchange

    Run the query in any quarter and if you want to get all the records in that quarter (in that year) based on CREATION_DATE in tables : select * from emp_table where CEIL( (EXTRACT(month from …

  10. Finding which DATE columns have no time data using TRUNC

    Jul 23, 2018 · I'm in the process of converting an Oracle db to a PostgreSQL one. The script I used converted all Oracle's DATE columns into TIMESTAMPS, but I suspect that most of those do not …