join - SQL syntax at joining 2 tables via aliases for resulting tables? -


i'm trying sense sql. correct following logic below ? can use brackets as here ?

-- 1 (table1) inner join (table2) on ( ??? )  -- 2 (table1 a) inner join (table2 b) on (a.col1 = b.col1)  -- 3 ((select ... ... ...) a)     inner join ((select ... ... ...) b)     on (a.col1 = b.col1) 

this doesn't work me.


failing query:

((select createdate, belegnrrech, mnr, utnr, ktxt infor.relfbr (saint = '90') , (createdate >= '01.01.14 00:00:00')) a)     inner join ((select anr, mnr infor.relxdb (saint = '10')) b)     on (a.mnr = b.mnr)  -- error message: ora-00907: missing right parenthesis 

i'm using c# send sql queries:

string q1 = "select createdate, belegnrrech, mnr, utnr, ktxt infor.relfbr " +     "where (saint = '90') , (createdate >= '" + date.tostring("dd.mm.yy hh:mm:ss") + "')"; string q2 = "select anr, mnr infor.relxdb (saint = '10')"; string query = "(" + q1 + ") inner join (" + q2 + ") b on (a.mnr = b.mnr)";  // q1 , q2 work, not query 

inner join ((select anr, mnr infor.relxdb (saint = '10')) b)     on (a.mnr = b.mnr) 

should be

inner join (select anr, mnr infor.relxdb (saint = '10')) b     on (a.mnr = b.mnr) 

select in brackets should have alias outside used in on


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -