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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:37:40+00:00 2026-05-23T00:37:40+00:00

How could this be happening? sqlite> select read, text from message; 1|No just got

  • 0

How could this be happening?

sqlite> select read, text from message;
1|No just got off the train
1|yadayada
1|Beautiful
1|<3
1|DONE <3
0|Hey

sqlite> select read, text from message where read=0;
0|
0|Ooo very cool
0|Donors choose?
0|No prize for the computer reading program / model/master class
0|Hey

I am truncating the very long results from each SQL query. These are the last few results from each. As far as I am aware, there is only one record with column read=0, but when I add the where clause, suddenly all the records return with that value. To confuse things further, the results are different, or at least in a different order, the output is too long for me to be sure.

Thank you very much for your time and help.

  • 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-05-23T00:37:41+00:00Added an answer on May 23, 2026 at 12:37 am

    You’re not providing an “order by” clause in either SQL statement, so the results are being returned to you in the default order – which is probably by their primary key (if one exists) or by the order they were inserted into the table.

    The provided truncation from your first query is most likely the last 6 records in that table. The provided truncation from your second query is most likely the last 6 records in that table WHERE read = 0.

    In summary, just because you only see 1 record where read = 0 in the 6 rows you provided from your first query doesn’t mean there is only 1. It just means there was only 1 in the last 6 rows. If you wanted to see all the “read = 1” rows first and then all the “read = 0” rows last, trying adding an “order by” clause.

    sqlite> select read, text from message order by read, text;
    
    sqlite> select read, text from message where read=0 order by text;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This could be a little off the ballpark, but a friend asked me about
Could someone point out why this could be happening: I am using NHibernate and
Got something like this <div class=something> <div></div> <p> Some text here </p> </div> This
Could someone please explain why this happening: class Apple { String type; setType(){ System.out.println(inside
I have a lot of classes in the App_Code directory could this be a
I have roughly the following code. Could this be made nicer or more efficient?
This could be weird, Have you ever come across a blog which you wanted
I could do this in C#.. int number = 2; string str = Hello
I could do this myself given time but does anyone have a nice asp.net
Can anybody please explain how this could possibly happen? I am completely aware of

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.