Questions tagged [ansi-sql-92]
35 questions
2
votes
1 answer
ANSI 92 Date Difference not working in MySQL
I'm, trying to calculate the number of days between two dates using ANSI SQL standard. But I'm missing something as this statement returns NULL in MySQL.
SELECT EXTRACT(DAY FROM DATE('2009-01-25') - DATE('2009-01-01')) AS day_diff;
I'm aware of…

Andre
- 1,347
- 3
- 14
- 23
1
vote
1 answer
CHECK constraint evaluation in SQL 92
when is check constraint evaluated as per SQL 92 standards?
create table a (
val INT
);
create table b (
f CHECK ( f in (SELECT val from a))
);
a) Is CHECK with sub-query allowed as per SQL-92 standards?
b) If yes, When is CHECK…

Khushit Shah
- 546
- 6
- 20
1
vote
2 answers
replacing TSQL NOT EXISTS in SQL-92
I am have following code which works well in TSQL:
BEGIN
IF NOT EXISTS (select * from tblDCUSTOM where id = 'All Customers')
BEGIN
INSERT INTO tblDCUSTOM
(ID
,Name
,English
)
SELECT 'All Customers','All…

Lukáš Tomšů
- 69
- 4
1
vote
0 answers
How use arithmetic operators in Orchard Core SQL Query select clause
I have tried to run this SQL-92 query:
select (Rating * 100.0) as ratingCalc from BlogPostStatsPartIndex;
on "Run SQL Query" page in admin but it has failed with error:
"Syntax error, expected: ALL, DISTINCT, id_simple, * at line:0, col:7".
This…

v.vyhonskyi
- 21
- 4
1
vote
2 answers
How to get the month of a date with two digits in SQL-92?
I have a date format cell in my table, of which I need to extract the month in two digits. This means that 6-4-2021 should return 04. The main problem is that this needs to be in the syntax of SQL-92. Any ideas on how to do this?

Emma van de Vreugde
- 103
- 1
- 10
1
vote
2 answers
a query from SQL/92 doesn't work in later versions
I have a sql query like this:
select tt.product_name, tt.countt
from (select ofr.product_name as product_name, count(*) as countt
from offers ofr
group by ofr.product_name) as tt
where 12 = (select max(tt.countt) from tt);
my problem is in the last…

Kamran Hosseini
- 478
- 5
- 25
1
vote
1 answer
How to join table without using JOIN or any alias? SQL Server
I was wondering is it possible to do a join on two tables without using JOIN or any alias for the tables?
For example I usually do:
SELECT *
FROM table1 a
LEFT JOIN table2 b ON a.column = b.column
From my understanding, the join I did above is…

bingaloman
- 43
- 1
- 2
- 9
1
vote
2 answers
Copying an entire, large OpenEdge table
I need to find the fastest way of reading a large OpenEdge table (100 million rows plus), preferably programmatically (in c#) and outside of ETL tools such as SSIS or staging formats such as text file extracts.
I'm currently using ODBC (driver:…

Drammy
- 940
- 12
- 30
1
vote
3 answers
Update Table 1 memo field with values from table 2 in a one-to-many relationship
I have 2 tables I would like to update one column in table 1 with values from table 2 where id=id. However table 2 has many rows matching table 1 and all rows of table 2 would need to be updated to 1 row in table 1
Table_A
id | all_names …

Yon
- 31
- 7
1
vote
0 answers
Apache Derby (JavaDB) concatenation regarding SQL92T (Prepend String to existing dataset)
I am new with JavbDB and need to simply append a string to a existing database cell like this:
public boolean updateChildNodes(String filePath, String parentPath)
throws SQLException {
// Set new parent path for all child nodes
…

metamagikum
- 1,307
- 15
- 19
1
vote
0 answers
How to pass cyrillic symbols in CMIS query?
I'm using CMIS query language to query information from my Alfresco server. Some of content's properties have Cyrillic names. When I try to insert this names in WHERE clause, I get an error:
[exception] => invalidArgument
[message] => line…

Dmitriy Korobkov
- 867
- 1
- 11
- 25
1
vote
1 answer
Cant use insert with subquery
This problem is really weird and I believe related with Access itself.
I`m trying to insert this way (really simplified version, but anyway the error is the same):
INSERT INTO phones(a, b)
select * from ( select C, D from banks) AS BB;
Access…

Rocketq
- 5,423
- 23
- 75
- 126
1
vote
1 answer
SQL WHERE IN Clause Returning no Rows when comparing with nested functions (Crystal Reports Command with SQL-92 DB)
I am looking to delimit a Crystal Reports variable in my SQL query on behalf of the user so that they can provide input in the format of "customer1, customer2, customer 3" vs. "'customer1', 'customer2', customer3'". I can format the string on…

Robert Hartshorn
- 176
- 10
1
vote
1 answer
Search pattern % doesnt work in access
In the table trans I have two such values t_bar and t_pro, and I want to find such values in the table. that start with "t_" So I`m using such query:
select trim(col)
from trans
where trim(col) like "t_%";
No rows are returned. However such query…

Rocketq
- 5,423
- 23
- 75
- 126
1
vote
1 answer
Access: How to alter column to counter with existing rows in table?
I know that it can't be easily solved by this statement:
ALTER TABLE BLOCK ALTER COLUMN block_id COUNTER(5000,1) PRIMARY KEY;
-- I get here error saying about wrong column type
Because of 2 reason:
the table must be empty
the table must not…

Rocketq
- 5,423
- 23
- 75
- 126