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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:18:03+00:00 2026-06-08T14:18:03+00:00

I’m stuck on a MySQL query and don’t know what I’m doing wrong (using

  • 0

I’m stuck on a MySQL query and don’t know what I’m doing wrong (using MySQL 5.0.88).

Here is my Query:

SELECT b.some, b.thing, bt.else AS liefdatum_gewuenscht, bt.bar
    FROM btable AS b
        LEFT JOIN bschedule AS bt 
            ON bt.key= b.key
            AND bt.type = b.type
        WHERE 
             b.entry_from IN (1,2,3,4)
        AND b.`status` = "2" 
        AND b.date >= 20120718
        LIMIT 1,10

The query should return a single record, but the check for b.status causes an empty response, although the record in question has a status of 2 with 2 being a CHARfield.

If I comment out the line it returns the correct record, however I would like to know what I’m doing wrong?

Can anyone give me hint?

Thanks!

EDIT
After some more testing I think it b.status isn’t the problem, because if I use any other column and value from the record in question it also return nothing.

E.g. the record will have columns

 ==== no =====  written_by ===== 
     1111         john smith

so putting in:

AND b.no = 1111 OR b.written_by = "john smith"

also return an empty resultset.

EDIT2
Here is a sample dataset and the query. I left out the LEFT JOIN because it doesn’t make any difference:

SELECT b.*
FROM bk AS b
WHERE 1
AND b.entry_from IN ( 9900000002985 )
AND b.`status` = "2  "
AND b.bestelldatum >= 20120718
LIMIT 1,10

Table:

CREATE TABLE `bk` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`entry_from` VARCHAR(13) NULL DEFAULT NULL,
`placed_at` VARCHAR(13) NULL DEFAULT NULL,
`type` VARCHAR(2) NULL DEFAULT 'SF',
`no` VARCHAR(35) NULL DEFAULT NULL,
`date` DATE NULL DEFAULT NULL,
`written_by` VARCHAR(35) NULL DEFAULT 'Händler',
`status` VARCHAR(3) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB;

hm… how to paste a record… this is the record in question

id = 985
entry_from = 9900000002985
placed_at = 9900000003005
type = SF
no = 11
date = 2012-07-19
written_by "Fachhändler"
status = 2
  • 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-08T14:18:10+00:00Added an answer on June 8, 2026 at 2:18 pm

    Try LIMIT 0,10 instead. That should work.

    Since it’s a CHAR type comparison, you may want to use LIKE function or STRCMP function instead of = operator.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.