0

In my table student, there is a column attendance of BIT(1) data type. But when I do:

Insert into student values('False')

Mysql is giving error that data is too long but i have found in some article we can enter false and true in it. Also when I insert 1 or 0 and i try to print data on my screen:

Select * from student

It give some character like '?' as result. I need help in both of the queries.

1 Answer 1

1

'False' is string then try use the related bit value

 Insert into student values(0)

and if you need a decoded string as result

 select if(your_bit_column, 'True', 'False') 
Sign up to request clarification or add additional context in comments.

1 Comment

Insert into student values(false) should work too

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.