Board index » delphi » Local SQL?

Local SQL?

Hi all!
Look at this expression:

select table.field1, table.field2, table.field3 from table, prev_table
where
table.field1 = prev_table.field1
and
(
  table.field2 <> prev_table.field2
    or
  table.field3 <> prev_table.field

Quote
}

This is not working with Borland Local SQL. I got a message "Capability not
supported". Help me, please, find similar expression in Local SQL.
Artem.

Regards.

 

Re:Local SQL?


Delphi seems to like to see multiple expressions wrapped in parenthesis,
and field declarators wrapped in double quotes, so try it like this:

 select tbl_1."field1",
        tbl_1."field2",
        tbl_1."field3"
   from table tbl_1,      (* use SQL aliases whenever *)
        prev_table tbl_2  (* possible *)
   where
        (tbl_1."field1" = tbl_2."field1")
            and
        ( (tbl_1."field2" <> tbl_2."field2")
               or
          (tbl_1."field3" <> tbl_2."field") )

Hope this helps.

Other Threads