Mysql doesn't make a sample of dates right.



  • I'm making this request.

    SELECT
      *
    FROM
     `ads`
    WHERE
     (name <> "tmp" AND
      ads.reg_date >= "2016-06-20" AND
      ads.reg_date <= "2016-06-20") AND
     (`user_id`='126')
    

    returns the void. if I do so

    SELECT
      *
    FROM
      `ads`
    WHERE
     (name <> "tmp" AND
      ads.reg_date >= "2016-06-20" AND
      ads.reg_date < "2016-06-21") AND 
     (`user_id`='126')
    

    I mean, it's a good one-- What is it, gentlemen?



  • Another option to consider the time frame, namely: SELECT ♪ FROM adsWHERE (name verbal "tmp" AND ads.reg_date grad=2016-06 - 00:00) AND ads.reg_date PO=2016-06-20 23:59:59) AND (sighs)user_id='126')




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2