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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:22:38+00:00 2026-06-17T15:22:38+00:00

here is my user_crime_details table: When I try this query: SELECT * FROM (`user_crime_details`)

  • 0

here is my user_crime_details table:

enter image description here

When I try this query:

SELECT * 
FROM (`user_crime_details`)
WHERE  `group_id` =  '1'
AND  `insert_date` = CURDATE( ) 
OR  `last_update_date` = CURDATE( ) 
ORDER BY  `id` DESC 

This is always the result:

enter image description here

You can see the results are wrong because the group_id’s not equal to 1 were also selected.
Is there something wrong with my query? Pls 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-06-17T15:22:39+00:00Added an answer on June 17, 2026 at 3:22 pm

    you need to group the condition by adding parenthesis on the OR part.

    WHERE  group_id =  1  AND  
           (insert_date = CURDATE() OR  last_update_date = CURDATE())
    

    and which is the same as

    WHERE  group_id =  1 AND CURDATE() IN (insert_date, last_update_date)
    

    PS: the backticks around the columns are optional since the names are not on the list of reserved keywords in MySQL.

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

Sidebar

Related Questions

I've got 3 tables that are something like this (simplified here ofc): users user_id
I have an interface like this: public interface IUser{ //some properties here T ToDerived(User
Ok, I googled and found some answers here on this site regarding this, but
All, I've been developing Flash applications for several years, and here's something I've always
Newbie user here, first time I post here so I'll try to make it
First time bitnami user here. I'm having some problems after installing this bitnami ami
This piece of JSON right here: {user:[{idUser:1,username:USERNAME,userFullName:FULL NAME,userEmail:EMAIL@MAIL.COM}]} Does not validate in jsonlint also
This question has been asked here in one form or another but not quite
I'am making a query in which I want to select those records which when
New but keen jquery user here, please be gentle :) I am using the

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.