About 50 results
Open links in new tab
  1. postgresql - Double colon `::` notation in SQL - Stack Overflow

    Jun 23, 2022 · It varies based on RDBMS, but if I guess right, that's PostgreSQL, in which case the :: converts a.dc to a date type of date. In other flavors... In MS SQL Server 2000: For built-in user …

  2. Error in Zeppelin notebook stating unable to create a sink

    Oct 7, 2023 · I am trying to write to from 1 KDS to another after processing in Apache Flink. I have used Zeppelin notebook to create sink table with the following query : %flink.ssql CREATE TABLE …

  3. sql server - What is Select 'X'? - Stack Overflow

    Oct 2, 2011 · 6 sSQL.Append(" SELECT 'X' "); sSQL.Append(" FROM ProfileInsurancePlanYear "); sSQL.Append(" WHERE ProfileID = " + profileid.ToString() + " AND CropYear = " + …

  4. Getting only Month and Year from SQL DATE - Stack Overflow

    Nov 23, 2009 · SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, <dateField>), 0) AS [year_month_date_field] FROM <your_table> This gets the number of whole months from a base …

  5. How to get sp_executesql result into a variable? - Stack Overflow

    May 4, 2009 · I have a piece of dynamic SQL I need to execute, I then need to store the result into a variable. I know I can use sp_executesql but can't find clear examples around about how to do this.

  6. Calculate a Running Total in SQL Server - Stack Overflow

    May 14, 2009 · DECLARE @TotalTable table(ord int primary key, total int, running_total int) DECLARE forward_cursor CURSOR FAST_FORWARD FOR SELECT ord, total FROM #t ORDER BY ord …

  7. How to script out stored procedures to files? - Stack Overflow

    Aug 14, 2013 · For recent versions, source code for stored procedures is available via the system view sys.sql_modules, but a simpler way to get the source for a stored procedure or user-defined function …

  8. Select data from date range between two dates - Stack Overflow

    Jan 8, 2013 · Now what is the query if I want to select sales data between two dates from a date range? For example, I want to select sales data from 2013-01-03 to 2013-01-09.

  9. How to execute store procedure for another DB? - Stack Overflow

    WHERE DATA_TYPE = 'varchar' AND TABLE_CATALOG = @Database AND TABLE_SCHEMA = @TableSchema AND TABLE_NAME = @TableName -- [TargetDB] = @Database The TargetDB will …

  10. How to Ignore "Duplicate Key" error in T-SQL (SQL Server)

    A have a many-to-many relation, products and categories. I have a table with just product_id and category_id and an unique index. With IGNORE_DUP_KEY i can just add products (a,b,c) to …