Questions tagged [ansi-sql]

ANSI SQL is the American National Standards Institute adopted Structured Query Language standard, developed by ISO/IEC JTC 1. It is the base for the different SQL dialects used by different DBMS vendors.

ANSI SQL is the American National Standards Institute adopted Structured Query Language standard, developed by ISO/IEC JTC 1. It is the base for the different SQL dialects used by different DBMS vendors.

SQL/PSM (SQL/Persistent Stored Modules) is the ISO standard defining an extension of SQL with a procedural language for use in stored procedures.

In Oracle PL/SQL (for stored procedures) and SQL (for queries) are two completely different languages (and are internally executed by different engines). DB2, PostgreSQL and Firebird also make clear distinction between the query language (called SQL) and the procedural language (for which every vendor uses a different name).

Microsoft SQL Server doesn't make this distinction: only T-SQL is used which covers the query language and the procedural language.

355 questions
-2
votes
1 answer

list aggregation

Is there a way to do list aggregation in ANSI SQL? I am aware that some of the RDBMS provide in-built functions like listagg() in Oracle etc. I tried to look for the ANSI standard document but looks like we have to purchase it (would have been nice…
stech
  • 675
  • 2
  • 9
  • 22
-2
votes
1 answer

Delete rows by date in ANSI SQL

I want to remove rows from last day, I have a date column, how can I do this in ansi? delete from mytable where mydate < current_date; This query deletes both yesterday's and today's records, I want to keep today's records ('today' is from 12 am…
Naty Bizz
  • 2,262
  • 6
  • 33
  • 52
-3
votes
1 answer

Joining two tables based on column regular expression matching

AIM: To join two tables contingent on one column from one table containing a word mentioned in another column from another table. TABLE 1: tibble::tribble( ~ORDER_ID, ~SUPERNAME_WITH_MODS,…
delcast
  • 496
  • 1
  • 5
  • 16
-3
votes
3 answers

(probably) very simple SQL query needed

Having a slow day....could use some assistance writing a simple ANSI SQL query. I have a list of individuals within families (first and last names), and a second table which lists a subset of those individuals. I would like to create a third table…
Keith
  • 23
  • 3
-3
votes
1 answer

Oracle-Conveting SQL to ANSI SQL

This is regarding converting query to ANSI SQL. I tried writing this query with Oracle old syntax and it threw the following error so I ended up changing it as shown below . After researching, I found that ANSI SQL supports such requirements.…
Tina
  • 53
  • 1
  • 9
-3
votes
1 answer

How do i join given two table in efficient way using sql query

We are having two tables A and B. We are trying to summarize both table in a way that it gives following output as listed below : Table A : Today| WTD| MTD| QtrToDate| YTD| Description| Ord| Section| Dept 347271 916887 930606 944525 …
NEO
  • 389
  • 8
  • 31
-3
votes
1 answer

What is the equivalent of (+)<2 in ANSI SQL?

I want to turn this TableA.ColumnA(+)<2 into ANSI SQL. I already tried: (TableA.ColumnA<2 OR TableA.ColumnA IS NULL) It missed one row. Despite the fact that its ColumnA is (null). Edit (more context): Here is the query SELECT * FROM a, c WHERE…
ekip
  • 3
  • 2
-3
votes
1 answer

Convert T-SQL to ANSI-SQL

I want to convert my stored procedures from T-SQL to ANSI-SQL. Is there any tool or a checklist to do it?
-4
votes
2 answers

sql sum sales between date

The image explains everything. My aim is to the last table using sql. I will explain the logic with an example. Table 1 shows the expected sales. For instance, article 22 should be sold only between 1 janv and 4 jan. To make it simple we assume that…
S12000
  • 3,345
  • 12
  • 35
  • 51
1 2 3
23
24