Medoo
Medoo copied to clipboard
Table Aliases for Oracle queries don't work
Information
- Version of Medoo: 2.1.7
- Version of PHP: 8.1.8
- Type of Database (MySQL, MSSQL, SQLite...): Oracle
- System (Liunx|Windows|Mac): Windows
Describe the Problem When writing a select query for a Oracle database, if we try to set aliases for the tables, the query fails because Medoo puts "AS" keyword between the table name and its alias. This is not a valid syntax in Oracle.
Detail Code The detail code you are using causes the problem.
// Write your PHP code here
$data = $database->debug()->select(
'TABLE1',
[
'[><]TABLE2 (MYALIAS)' => ['ID' => 'EXTID']
],
'*'
);
**Expected output**
Expected result = SELECT * FROM "TABLE1" INNER JOIN "TABLE2" "MyAlias" ON "TABLE1"."ID" = "MyAlias"."EXTID"
Actual result: SELECT * FROM "TABLE1" INNER JOIN "TABLE2" AS "MyAlias" ON "TABLE1"."ID" = "MyAlias"."EXTID"
Thanks. I will test and fix for it.
I fixed it locally
I fixed it locally
can you provide textual diff? ))