Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8019025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:16:07+00:00 2026-06-04T21:16:07+00:00

I am new to SQL and thus facing some problems in enhancing a SQL

  • 0

I am new to SQL and thus facing some problems in enhancing a SQL query.

There are two tables basically: one is ef_dat_app_ef_link and the other is ef_dat_lspd_machine_type_model

Here is the query I am talking about. I have added an inner join in the 10th line which is the base of all problems.

select country_isocode as country,
language_isocode as language, model_number,
machine_type_model_name model_name,machine_type_group_id,
machine_type_model_id, product_type_name product_type,
machine_type_model_id_to,filenet_link 
from ef_dat_lspd_machine_type_model,
cross join ef_dim_lspd_country_language
left join ef_dat_lspd_model_country 
using (machine_type_model_id, country_isocode)
inner join ef_dat_app_ef_link on  (ef_dat_lspd_machine_type_model.lpmd_revenue_pid = ef_dat_app_ef_link.ef_product_revenue_pid)
where (ef_dat_app_ef_link.country_isocode='US' or ef_dat_app_ef_link.country_isocode='CA') and ef_dat_app_ef_link.language_isocode='en'
join ef_dat_lspd_product_type using (product_type_id)
left join ef_dat_lspd_model_relationship on (machine_type_model_id_from = machine_type_model_id) 
where (discontinue_date is null or discontinue_date > sysdate) and
(announce_date is null or announce_date <= sysdate)
and (machine_type_model_id in (select machine_type_model_id from ef_dat_lspd_model_parts)
or not machine_type_model_id_to is null) order by machine_type_model_id

Below is the unchanged query which I am supposed to work on.

select  country_isocode as country,
language_isocode as language,


machine_type_model_id,
product_type_name product_type,machine_type_model_id_to,
image_url
from ef_dat_lspd_machine_type_model cross join ef_dim_lspd_country_language 
left join ef_dat_lspd_model_country using (machine_type_model_id, country_isocode) 
join ef_dat_lspd_product_type using (product_type_id) 
left join ef_dat_lspd_model_relationship on (machine_type_model_id_from =    machine_type_model_id)
where (discontinue_date is null or discontinue_date > sysdate) and
(announce_date is null or announce_date <= sysdate) and
(machine_type_model_id in (select machine_type_model_id from ef_dat_lspd_model_parts) or >not machine_type_model_id_to is null)
order by machine_type_model_id

Now in the ef_dat_app_ef_link table there is a link with images,countrycode and languagecode and a revenueid and the other is ef_dat_lspd_machine_type_model which contains the image links and a few more columns. What I am trying to do is, create a query which shall replace pull up images from the ef_dat_app_ef_link table where the revenue id in this table is equal to the revenue id in the other table. A lot of columns come up when a table is searched by the revenue id, thats why i want to pull up a row which has language as ‘en’ and country as ‘US’ or ‘CA’.

I have added an inner join statement to the same effect but it is consistently throwing a ORA00905 error for a missing keyword.

I have italicized the changes I have made. Sorry for such a bad representation of the code. I couldn’t make head or tail of how to make it look better.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:16:08+00:00Added an answer on June 4, 2026 at 9:16 pm

    You added a WHERE clause smack dab in the middle of the existing query. You can’t have more than one WHERE clause in a query, and you also can’t place it in the middle of your table joins.

    illustrated issue

    Merge the WHERE clause you added to the pre-existing one (indicated by the green arrow in the snapshot).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing some new SQL queries and want to check the query plans
I'm relatively new SQL queries, and I'm trying to join two tables in order
I'm new to SQL and could use some help in creating a database schema
I'm brand new to SQL Server 2008, and have some newbie questions about the
I am new to SQL Server Management Studio and am wondering: is there is
As two parameters i say currentPage and pagesize .....I thus far used sql server
I've 2 classes. One is a linq-to-sql class and the other is a seriazable
Using OleDbCommand . I can add SQL parameters and thus keep the query safe
I've recently added a couple of fields to some tables in my database (SQL
When one creates a linq query as: var ids = new List<int> { 1,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.