Hi there,
I would like to use table alias(FROM <tbl> AS) in an SQL that has an INNERJOIN on another Table. Any tips for this are most welcome.
I want to do this because, i would like to have subquery in the where clause.
e.g.-
SELECT DISTINCT TABLE1.FIELD1, TABLE1.FIELD2,TABLE1.FIELD3
FROM TABLE1 AS T1 INNER JOIN TABLE2 ON TABLE1.FIELD1 = TABLE2.FIELDX
WHERE
NOT EXISTS
(SELECT * FROM TABLE1 AS T2 WHERE T1.FIELD2 = T2.FIELD1)
I want to use the alias for TABLE1 in the first part of the query. But it complains about hte invalid syntax.
I would like to use table alias(FROM <tbl> AS) in an SQL that has an INNERJOIN on another Table. Any tips for this are most welcome.
I want to do this because, i would like to have subquery in the where clause.
e.g.-
SELECT DISTINCT TABLE1.FIELD1, TABLE1.FIELD2,TABLE1.FIELD3
FROM TABLE1 AS T1 INNER JOIN TABLE2 ON TABLE1.FIELD1 = TABLE2.FIELDX
WHERE
NOT EXISTS
(SELECT * FROM TABLE1 AS T2 WHERE T1.FIELD2 = T2.FIELD1)
I want to use the alias for TABLE1 in the first part of the query. But it complains about hte invalid syntax.