Re: LEFT JOIN / USING doesn't work



"yawnmoth" <terra1024@xxxxxxxxx> wrote in message
news:1178659464.798373.127680@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SELECT * FROM location_stock LEFT JOIN stock USING (stock_num)

Why, when I run that, do I get this error back?:

Sybase: Server message: Incorrect syntax near the keyword 'USING'.
(severity 15, procedure N/A)

stock_num is a column common to both location_stock and stock. Isn't
that the only requirement USING really has?


ASE doesn't support 'USING'. Try a regular ON-clause instead:


SELECT *
FROM location_stock t1
LEFT JOIN stock t2 on t1.stock_num = t2.stock_num


HTH,

Rob V.
-------------------------------------------------------------
Rob Verschoor

Certified Sybase Professional DBA for ASE 12.5/12.0/11.5/11.0
and Replication Server 12.5 / TeamSybase

Author of Sybase books (order online at www.sypron.nl/shop):
"Tips, Tricks & Recipes for Sybase ASE" (new edition!)
"The Complete Sybase ASE Quick Reference Guide" (new edition!)
"The Complete Sybase Replication Server Quick Reference Guide"

mailto:rob@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
http://www.sypron.nl
Sypron B.V., P.O.Box 10695, 2501HR Den Haag, The Netherlands
-------------------------------------------------------------


.



Relevant Pages

  • Get Segmentation Fault when Building Sybase
    ... When trying to install sybase 15 on fedora core 8 get the following ... Building Adaptive Server 'LOCALHOST': ... Specify a configuration file name in the RUNSERVER file to avoid this ... No external security mechanisms will be supported. ...
    (comp.databases.sybase)
  • Recent updates at www.sypron.nl
    ... My books about ASE and RepServer are still are still very popular ... - "The Complete Sybase Replication Server Quick Reference Guide" ... Tricks & Recipes for Sybase ASE" ...
    (comp.databases.sybase)
  • Recent updates at www.sypron.nl
    ... 'purple book' "The Complete Sybase ASE Quick Reference Guide" ... - "The Complete Sybase Replication Server Quick Reference Guide" ... Tricks & Recipes for Sybase ASE" ...
    (comp.databases.sybase)
  • Re: DBD::Sybase question
    ... You can interact with an ASE 15 server with a 12.5.1 client with no ... interface with all sorts of Sybase servers (including an antique 4.9.2 ... Toute utilisation de ce ...
    (perl.dbi.users)
  • RE: DBD-Sybase 1.07, FreeTDS 0.63, HPUX 11.11: Build problem (maketest)
    ... I guess I assumed that since TDS supports the host+port that the Sybase ... > does not appear that DBD::Sybase reconizes the freetds config file ... > arguments, and seems to want a "Server", only. ... Toute utilisation de ce ...
    (perl.dbi.users)