Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

why is this query invalid?

Why is this query invalid? When I write just SRV_ID instead of vt_exam_details.SRV_ID everything works just fine

 cl_id
, cl_name_last as CUSTOMER
, vt_animals.an_type
, vt_exam_details.SRV_ID
, vt_services.srv_desc
, vt_exam_details.ex_fee
from vt_clients
join vt_animals using (cl_id)
join vt_exam_headers using (an_id)
join vt_exam_details using (ex_id)
join vt_services using (srv_id)

Error:

Error at Command Line:5 Column:3
Error report:
SQL Error: ORA-00904: "VT_EXAM_DETAILS"."SRV_ID": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause: 
*Action:

Thanks.

Answer*

Draft saved
Draft discarded
Cancel
2
  • SQL> describe vt_exam_details EX_ID NOT NULL NUMBER(6) LINE_ITEM NOT NULL NUMBER(6) SRV_ID NOT NULL NUMBER(6) EX_FEE NOT NULL NUMBER(6,2) EX_DESC VARCHAR2(50) } – Commented Feb 17, 2013 at 7:00
  • 1
    I think the answer is that, since I have join vt_services using (srv_id) I don't have to specify the table name for attribute srv_id Commented Feb 17, 2013 at 7:20

default

AltStyle によって変換されたページ (->オリジナル) /