0

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.

4
  • 3
    is vt_exam_details the right table for SRV_ID? Commented Feb 17, 2013 at 6:20
  • well.your error says that..the table vt_exam_details doesn't have any column named "SRV_ID". Commented Feb 17, 2013 at 6:26
  • 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 6:38
  • I'm sorry, I'm new here, so writing a little messy. as you can see I have that srv_id Commented Feb 17, 2013 at 6:46

2 Answers 2

1

Because the table vt_exam_details is not in the FROM clause?

answered Feb 17, 2013 at 6:51
Sign up to request clarification or add additional context in comments.

5 Comments

but my other tables are not in the FROM clause either
Could you post the columns in the table? easier to help that way. Also, could the case be different for the column names?
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) } –
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
Exactly! otherwise you would get error for vt_exam_details.ex_fee too.
0

Is there a SRV_ID in table VT_EXAM_DETAILS?

answered Feb 17, 2013 at 6:52

2 Comments

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) } –
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

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.