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

  • SEARCH
  • Home
  • 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 8172537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:48:50+00:00 2026-06-06T21:48:50+00:00

I am using java java.sql.* for querying from SQLite DB. I found a starnge

  • 0

I am using java java.sql.* for querying from SQLite DB. I found a starnge issue where I write a sqlString as:

SELECT n.Name as Name, 
       c.Value as Value0, 
       d.Value as Value1 
FROM  (Table1 c inner join Table2 n on c.NameID = n.ID),
      Table3 d 
WHERE c.RunID = 1 
      and d.RunID = 2 
      and c.NameID = d.NameID

The statement stmt.executeQuery(sqlQuery) throws the following exception:

java.sql.SQLException: no such column: n.Name
at org.sqlite.DB.throwex(DB.java:288)
at org.sqlite.NativeDB.prepare(Native Method)
at org.sqlite.DB.prepare(DB.java:114)
at org.sqlite.Stmt.executeQuery(Stmt.java:89).............

Name is already part of the Table2 table. The same statement is working fine from SQLite command prompt. But when I remove the open brackets and try to execute from java, there is no problem. Any idea why this happens so?

  • 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-06T21:48:51+00:00Added an answer on June 6, 2026 at 9:48 pm

    Try something like this, use sub resultset

    SELECT rs1.Name AS NAME, 
           rs1.Value0 AS Value0, 
           d.Value AS Value1 
    FROM  (SELECT n.Name AS NAME, 
           c.Value AS Value0, 
           d.Value AS Value1 
           FROM Table1 c INNER JOIN Table2 n ON c.NameID = n.ID) rs1,
          Table3 d 
    WHERE c.RunID = 1 
          AND d.RunID = 2 
          AND c.NameID = d.NameID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to execute the following query using java.sql.PreparedStatement: SELECT NVL (tb.ddate, '2002-10-15') FROM
I'm using Sqlite with Java using SQLiteJDBC . When querying sqlite, I've found out
I have this issue: first, I execute a SQL query using Java and then
I am using groovy's SQL querying functions and MarkupBuilder to write xml files. I
I'm currently wrestling with an Oracle SQL DATE conversion problem using iBATIS from Java.
hi i want to retrieve values from SQL database for xml tags using java
I am using Java JDBC to write a date to SQL server 2008 and
I am using java on sql server and I have a DB problem of
The weird behavior is that a java.sql.Timestamp that I create using the System.currentTimeMillis() method,
I'm using Hibernate with JPA and MySQL. I got accessing denied. java.sql.SQLException: Access denied

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.