ansi-sql Questions
3
Solved
Is there an ANSI SQL compliant version of SQL SERVER's SELECT TOP n?
Ced asked 11/2, 2013 at 0:32
2
Solved
Small working example
SELECT SPLIT("hello::hej::hallo::hoi", "::")
returns an array [hello, hej, hallo, hoi] where I want to select the first element i.e. hello. BG Standard provides no FIRST, i...
Garay asked 7/4, 2018 at 19:16
10
Solved
How do you rewrite expressions containing the standard IS DISTINCT FROM and IS NOT DISTINCT FROM operators in the SQL implementation in Microsoft SQL Server 2008R2 that does not support them?
Epact asked 2/5, 2012 at 15:24
9
Solved
I know:
Firebird: FIRST and SKIP;
MySQL: LIMIT;
SQL Server: ROW_NUMBER();
Does someone knows a SQL ANSI way to perform result paging?
3
Solved
Is the COALESCE a function of the ANSI SQL especification? Is it supported by the major relational databases?
3
Solved
I am interested in comparing, whether two tables contain the same data.
I could do it like this:
#standardSQL
SELECT
key1, key2
FROM
(
SELECT
table1.key1,
table1.key2,
table1.column1 - tabl...
Aschim asked 12/7, 2018 at 17:52
8
For example - I create database and a table from cli and insert some data:
CREATE DATABASE testdb CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';
USE testdb;
CREATE TABLE test (id INT, str VARCHAR(...
3
Solved
I am wondering if there is a method to implement SQL analytic functions without using the inbuilt functions.
SELECT *,
ROW_NUMBER() OVER (PARTITION BY dept_id ORDER BY salary DESC) AS rownum,
DE...
4
Solved
Is there an ANSI SQL equivalent to Oracle's DECODE function?
Oracle's decode function is the IF-THEN-ELSE construct in SQL.
6
What does || do in SQL?
SELECT 'a' || ',' || 'b' AS letter
2
Solved
My coworker, who is new to ANSI join syntax, recently wrote a query like this:
SELECT count(*)
FROM table1 t1
JOIN table2 t2 ON
(t1.col_a = t2.col_a)
JOIN table3 t3 ON
(t2.col_b = t3.col_b)
...
16
Solved
At every company I have worked at, I have found that people are still writing their SQL queries in the ANSI-89 standard:
select a.id, b.id, b.address_1
from person a, address b
where a.id = b.id
...
1
Solved
I have a simple table as bellow with lots of IDs and dates.
ID Date
10R46 2014-11-23
10R46 2016-04-11
100R9 2016-12-21
10R91 2013-05-03
... ...
I want to formulate a query which counts the u...
Tressietressure asked 5/12, 2017 at 17:0
4
Solved
I am trying to migrate some legacy procedural code. I am having trouble figuring out the ANSI standard syntax to produce the same results.
Below is one of the many combinations I have tried. What...
Fatling asked 29/8, 2012 at 21:7
3
Solved
I am trying to find the ANSI way to write the T-SQL 'IS NULL'. (corrected, was 'IN NULL')
Some posts on the internet say you can use coalesce to make it work like 'IS NULL'
The reason I like to do...
2
Most SQL databases follow the ANSI SQL standards to a degree, but
The standard is ambiguous, leaving some areas open to interpretation (eg: how different operations with NULLs should be handled i...
Ticking asked 21/9, 2011 at 6:39
3
Solved
I have a set of data that has been created by matching together similar sub-items, and then GROUPing these similar items by "category".
Now, the resultant categories must be matched in such a way ...
3
Solved
This has always bothered me - why does the GROUP BY clause in a SQL statement require that I include all non-aggregate columns? These columns should be included by default - a kind of "GROUP BY *" ...
2
Solved
The question sounds confusing, but just look:
This way we can get the first column (col1):
select distinct maker
from product
And the second column (col2):
select distinct type,maker
from prod...
Bollix asked 26/3, 2015 at 11:6
2
I am new to SQL and have been searching for a way to set variables in ANSI SQL. I have this:
select * from table1
where first_date > '2014-01-01'
and where second_date = '2014-01-01'
and where t...
1
Solved
This is my query that does not work in Netezza:
UPDATE TABLE1 A
SET A.COL1= (SELECT DISTINCT B.COL1 FROM TABLE2 B WHERE B.ID= A.ID AND B.DeptID=104)
WHERE A.DeptID=3
How do I re-write this query...
7
Solved
Is there an ANSI SQL alternative to the MYSQL LIMIT keyword?
The LIMIT keyword limits the number of rows returned by a SELECT e.g:
SELECT * FROM People WHERE Age > 18 LIMIT 2;
returns 2 rows...
4
I am loking to implement a paging query in ANSI SQL.
I tried the following query in SQL Server, but it did not allow it:
select top 20 * from MyTable order by id
except
select top 10 * from MyTa...
2
Solved
I have the following table structures in a Postgres 9.1 database but the ideal solution should be DB agnostic if possible:
Table: users
|id|username|
|1 |one |
|2 |two |
|3 |three |
Table: items...
Bak asked 17/8, 2013 at 15:46
3
Solved
I'm using SQL (SQL Server, PostgreSQL) over 10 years and still I'm never used ANY/SOME and ALL keywords in my production code. All situation I've encountered I could get away with IN, MAX, MIN, EXI...
Magdamagdaia asked 11/7, 2013 at 8:1
1 Next >
© 2022 - 2024 — McMap. All rights reserved.