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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:07:07+00:00 2026-06-02T01:07:07+00:00

I have a table called bank with three columns: uid , nick , balance

  • 0

I have a table called bank with three columns: uid, nick, balance.

I am trying to create a query that will return the balance based on the nick, and I am getting an error Unknown column 'Alex' in 'where clause' when I use this query:

SELECT b.balance FROM bank AS b WHERE b.nick=`Alex` LIMIT 1

Can anyone see what I am doing wrong here?

  • 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-02T01:07:08+00:00Added an answer on June 2, 2026 at 1:07 am

    backticks (`) are used for identifiers, like table names, column names, etc. Single quotes(‘) are used for string literals.

    You want to do:

    SELECT b.balance FROM bank AS b WHERE b.nick='Alex' LIMIT 1
    

    Or, to be more explicit:

    SELECT `b`.`balance` FROM `bank` AS b WHERE `b`.`nick`='Alex' LIMIT 1
    

    When there is no chance of ambiguity, and when table/column names do not have special characters or spaces, then you can leave the ` off.

    Here is some documentation that is dry and hard to read: http://dev.mysql.com/doc/refman/5.0/en/identifiers.html

    But here is a related question on dba.stackoverflow that is easier to read: https://dba.stackexchange.com/questions/23129/benefits-of-using-backtick-in-mysql-queries

    And here is a very good page that I recommend everyone read: http://www.sitepoint.com/forums/showthread.php?408497-the-big-bad-thread-of-quot-MySQL-Best-Practices-and-Other-Useful-Information-quot

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

Sidebar

Related Questions

I have a table called Jrl with three columns: code AS varchar(15) total AS
I have table called emp . The table contains three columns empid , ename
I have table called Reporting with following columns OutletId CampaignId ItemId Qty 10 1
Assuming I have table called events with the columns INT id DATETIME start_time DATETIME
In my oracle database I have table called PERSON with columns code, surname, forename.
In my db I a have table called users. In that table I have
I have table called product review with columns productreviewid , productid , shopperid ,
I have table called articles_tags which have two columns: article_id tag_id (has_and_belongs_to_many association) (I
I have table called 'shipped_data' https://i.stack.imgur.com/JXBej.png and need go get all 'caseNumbers' that match
I have a table called CountriesList with ID and Country columns. I have another

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.