简体   繁体   中英

ORA-00905: missing keyword in oracle query

I have 2 tables category and coupon_category in my oracle database

I am making query

select coupon_category.coupon  from coupon_category  JOIN category;

which gives me error

SQL>    select coupon_category.coupon  from coupon_category INNER JOIN category;
        select coupon_category.coupon  from coupon_category INNER JOIN category
                                                                              *
ERROR at line 1:
ORA-00905: missing keyword

What is the mistake I am making?

The issue seems to be a misunderstanding of join syntax. Your current code is combining the old and new syntax for joining two tables. The proper join can be accomplished by using either correctly (with the ON syntax preferred).

select coupon_category.coupon from coupon_category INNER JOIN category ON coupon_category.coupon=category.id;
--OR
select coupon_category.coupon from coupon_category, category where coupon_category.coupon=category.id;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM