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 7923769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:25:23+00:00 2026-06-03T17:25:23+00:00

Hi The following query is returning: No column name was specified for column 1

  • 0

Hi The following query is returning: No column name was specified for column 1 of ‘t’.

  public ArrayList<DocumentModel> findByDate(String code, String date, String dateFinal) throws GeneralException{
    ArrayList<DocumentModel> docs = new ArrayList<DocumentModel>();
    String d1 = date;
    String delimiter = "-";
    String[]temp = d1.split(delimiter);
    String[]temp2 = dateFinal.split("-");
    String num="";
    String alfa="";
    if (code.compareTo("")!=0){
        String[] c1 = code.split(",");
        num = c1[0];
        alfa = c1[1];
    }

    try{
        String sql = "SELECT max(issuedate),airlineOid as airlineNumericCode FROM Document  WHERE ";

        if (alfa.compareTo("")!=0) sql+=" airlineOid='"+alfa+"' and ";

        sql+=" convert(varchar,issueDate,112) >= '" + temp[0]+ temp[1] +"00'  AND convert(varchar,issueDate,112) < '"+ temp2[0]+ temp2[1] +"32' group by airlineOid";

        String sql2="select d.*,'"+num+"' as airlineNumericCode from document d,("+sql+") as t where t.airlineOid=d.airlineOid and t.issueDate=d.issueDate ORDER BY issueDate DESC ";

        ResultSet rs = this.executeQuery(sql2);
        while(rs.next()){
            docs.add((DocumentModel)this.build(rs));
        }
        if(docs != null){
            return docs;
        } else {
            return docs = null;
        }
    } catch (SQLException ex){
        throw new GeneralException(ex);
    }
}

I cannot see where I should specify the name.
Thank you very much!
Best Regards
Ignacio

  • 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-03T17:25:25+00:00Added an answer on June 3, 2026 at 5:25 pm

    I think this is your problem….you rename airline0id to airlineNumericCode in SQL. Then, in sql2, you try to refer to it as airline0id. Try this:

    String sql = "SELECT max(issuedate) as issueDate,airlineOid as airlineNumericCode FROM Document  WHERE ";
    
    ...
    
    String sql2="select d.*,'"+num+"' as airlineNumericCode from document d,("+sql+") as t where t.airlineNumericCode=d.airlineOid and t.issueDate=d.issueDate ORDER BY issueDate DESC ";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following query: SELECT DISTINCT ClassName FROM SiteTree ORDER BY ClassName is returning things
I have the following LINQ expression that's not returning the appropriate response var query
The following query uses an index seek on an index on the LastModifiedTime column.
I have the following query. What is strange is that it is returning multiple
When executed the following query it is returning null. Explanation: the longitude is a
The following query ( V_TITRATION_RESULTS ) is a view uses a row-to-column pivot which
I hope following sample code is self-explanatory: declare @t1 table (ID int,Price money, Name
i need to make a group by clause with the following query: SELECT NAME,
Working SQL The following code works as expected, returning two columns of data (a
the following mysql query is only returning a single row when it should be

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.