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

  • Home
  • SEARCH
  • 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 3235986
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:34:11+00:00 2026-05-17T17:34:11+00:00

I have two tables. In one I have column like INT and in other

  • 0

I have two tables. In one I have column like INT and in other I have row like VARCHAR where I wait user id or unique id for quest with letters…I want compare if INT = VARCHAR in mysql query. I am using:

BINARY int_row = BINARY varchar_row

is this ok ?

  • 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-05-17T17:34:11+00:00Added an answer on May 17, 2026 at 5:34 pm

    As long as you’re comparing only numbers, it won’t matter. There will be an implicit conversion anyway so that the varchar and int fields can be compared.

    The only problem I can think of is if the varchar field can contain values like this:

    1ABCDEFGHIJK
    

    you may get into trouble here, because a conversion of this varchar into a number would result in 1!

    To make sure, I would tend to use

    BINARY CAST(int_row AS CHAR) = BINARY varchar_row
    

    but this can be overly paranoid – correct me if I’m wrong.

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

Sidebar

Related Questions

I have two tables and their only difference is one column is missing from
I have two table. One table hold key column and xml column. Other table
I have two tables one called fs_note the other called dumy_fs_note I created after
I have two domain objects like below User.java Public class User{ private int userId;
I have a table with two columns and one row, and 100% width across
I have two tables one with ID and NAME table 1 ID | NAME
i have two tables one is called addons and holds information about different addons,
I have two entities like public class Person { public int PersonId { get;
I have two tables, Table_1 and Table_2 . Table_1 has columns PK (autoincrementing int
I have two tables that I would like to treat as a single model

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.