Top "Ansi-sql" questions

Standard SQL boolean operator IS vs. equals (=) operator

On the Wikipedia page for SQL there are some truth tables about boolean logic in SQL. [1] The Wikipedia page seems …

sql null boolean-logic ansi-sql
Number of days between two dates - ANSI SQL

I need a way to determine the number of days between two dates in SQL. Answer must be in ANSI …

sql date date-arithmetic ansi-sql
Ansi SQL type casting

Is it allowed to cast types in ANSI SQL like in postgres for example: SELECT SUM( CAST(qnty AS int) …

sql casting ansi-sql
How to write these two queries for a simple data warehouse, using ANSI SQL?

I am writing a simple data warehouse that will allow me to query the table to observe periodic (say weekly) …

sql data-warehouse ansi-sql
BigQuery Standard SQL: how to return the first value of array?

Small working example SELECT SPLIT("hello::hej::hallo::hoi", "::") returns an array [hello, hej, hallo, hoi] where I want to …

sql google-bigquery ansi-sql
ANSI equivalent of IS NULL

I am trying to find the ANSI way to write the T-SQL 'IS NULL'. (corrected, was 'IN NULL') Some posts …

sql coalesce isnull ansi-sql
MySQL replace result value with another value

I have MySQL and the query is: select name,re_type from myTable I want to replace all values of …

mysql sql case-when ansi-sql
Select 1000 distinct names from 100 million records via standard sql

I have a table tb_FirstName with one field FirstName. The table has 100 million non null records with lots of …

sql sql-server standards ansi-sql
Implement Rank without using analytic function

I am wondering if there is a method to implement SQL analytic functions without using the inbuilt functions. SELECT *, ROW_…

sql ansi-sql
Comparisons with NULLs in SQL

ANSI-92 SQL mandates that comparisons with NULL evaluate to "falsy," eg: SELECT * FROM table WHERE field = NULL SELECT * FROM table …

sql null ansi-sql