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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:48:20+00:00 2026-06-05T19:48:20+00:00

Statement st=conn.createStatement(); String sql=SELECT a.ID,a.A_TEXT,a.B_TEXT,a.C,a.D_TO_E,a.F_TEXT,a.G,a.INTIME,b.EXIT_TIME FROM tm_A a LEFT JOIN tm_B b ON a.ID=b.ID

  • 0
Statement st=conn.createStatement();
String sql="SELECT a.ID,a.A_TEXT,a.B_TEXT,a.C,a.D_TO_E,a.F_TEXT,a.G,a.INTIME,b.EXIT_TIME FROM tm_A a LEFT JOIN tm_B b ON a.ID=b.ID WHERE EXIT_TIME=''";

ResultSet rs=st.executeQuery(sql);

while(rs.next())
    {

    arls.add(rs.getString("ID"));
    arls.add(rs.getString("A_TEXT"));
    arls.add(rs.getString("B_TEXT"));
    arls.add(rs.getString("C"));
    arls.add(rs.getString("D_TO_E"));
    arls.add(rs.getString("F_TEXT"));
    arls.add(rs.getString("G"));
    arls.add(rs.getString("INTIME"));
    arls.add(rs.getString("EXIT_TIME"));

    }

I have above code in that i want to retreive values from two tables where EXIT_TIME =’null’
but i am getting nothing after executing though there are value in table tm_A
but if i remove where clause then i am getting result and but under EXIT_TIME it displays ‘null’ and where there are values that are displaying

  • 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-05T19:48:22+00:00Added an answer on June 5, 2026 at 7:48 pm

    If you want to select a result where a column is null you have to use the is operator:

    SELECT a.ID,a.A_TEXT,a.B_TEXT,a.C,a.D_TO_E,a.F_TEXT,a.G,a.INTIME,b.EXIT_TIME 
    FROM tm_A a 
    LEFT JOIN tm_B b ON a.ID=b.ID 
    WHERE EXIT_TIME is null
    

    Comparison with null will always result to unknown. That is why you need the is operator instead of =

    using EXIT_TIME='' would compare EXIT_TIME to an empty string but not null

    If you want all records that are not null in EXIT_TIME you can use

    WHERE EXIT_TIME is not null
    

    Edit

    You can use case to avoid null in your textboxes:

        SELECT a.ID, 
           a.A_TEXT,
           a.B_TEXT,
           a.C,
           a.D_TO_E,
           a.F_TEXT,
           a.G,
           a.INTIME,
           case when b.EXIT_TIME is null
                then 'NA'
                else b.EXIT_TIME
           end as EXIT_TIME
    FROM tm_A a 
    LEFT JOIN tm_B b ON a.ID=b.ID 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

String query = select email from emp_select; Statement stmt; try { DB db=new DB();
Statement stmt=conn.createStatement(); //1 Statement stmt2=conn.createStatement(); //2 ResultSet resultSet1=stmt.executeQuery(-----); //3 while(resultSet1.next()) { //4 ResultSet resultSet2
try { PreparedStatement s = (PreparedStatement) conn.prepareStatement(SELECT voters.Check,count(*) FROM voting.voters where FirstName=+first+and LastName=+last+ and
Connection conn = null; Statement stmt=null; ResultSet rset=null; String jdbc_url=jdbc:oracle:thin:hr/hr@bassam-desktop:1521:XE; String query=; try {
Set rs = conn.Execute(Statement) //rs has 6 fields I want to add the current
SQL statement: INSERT INTO order (`ORDER_ID`,`SALE_CODE`,`CREATED_AT`,`UPDATED_AT`) VALUES ('2646253286','HPHS20','2009-07-11 12:07:40','2009-07-11 12:07:40') Error: You have an
this statement will generate a 4 column table: SELECT shipped.badguy AS badguy, shipped.sdate AS
my code is : Statement testSt = null; ResultSet rset = null; String query
I have a method for upgrading DB: private void executeUpdateBatch(String... sql) throws SQLException {
I have encountered a problem when trying to select data from a table in

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.