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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:13:49+00:00 2026-06-05T01:13:49+00:00

When I send query like SELECT id FROM private_messages WHERE to_id=1 AND opened=0 It

  • 0

When I send query like

SELECT id FROM private_messages WHERE to_id=1 AND opened=0

It doesn’t return anything

SELECT id FROM private_messages WHERE to_id=1 AND opened<>1

Returns all results where opened=0. opened columns type is enum with “1” and “0” (default) values. Question is, why first query doesn’t return anything?

  • 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-05T01:13:52+00:00Added an answer on June 5, 2026 at 1:13 am

    Since opened is an enum, you should write:

    SELECT id FROM private_messages WHERE to_id=1 AND opened='0'
    

    Enums are really just a set of possible strings. From the documentation:

    An ENUM is a string object with a value chosen from a list of
    permitted values that are enumerated explicitly in the column
    specification at table creation time.

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

Sidebar

Related Questions

If I have a simple query like: OPEN cursor FOR SELECT USER_ID FROM USER_TABLE
I have some code like this : PersistenceManager pm=PMF.get().getPersistenceManager(); String query=select from +PayPal_Message.class.getName()+ where
I have an MySQL query like this: SELECT MAX(messages.ID) as maxID, messages.from, messages.read, users.userName
Using the oledb provider. Query is something like this: SELECT appid FROM table WHERE
How to send such a query to database server from Rake task without removing
I have a WCF service that receive query from a silverlight client and send
Hi, this is my query: SELECT tbl_order_detail.order_id, tbl_order_lead_send_detail.customer_id, tbl_order_detail.order_title, tbl_order_detail.dealer_id , tbl_order_lead_send_detail.send_date_time FROM tbl_order_detail
PROBLEM: I want to run a query which would trigger something like select *
I have a requirement to send the results of a query in emails. I
I am trying to send some data from a LINQ query in C# to

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.