Well i got an error in mysql for which i banged my head for full 2 days and figured out it was a small change(I knw every bugs ends the ame way.. :)).Well , i didnt find any forum that explains about the bug and its solution.
Query: Select * from where tot = tot1
BUG: Unknown column "tot1" in where clause.
SOLUTION: Select * from where tot = 'tot1'
If the value of the tot1 is TOT it works fine if it is any thing other than that it gives an error. I could never figure why it acts so weird, Well if any1 knows the solution lets me know and simple image has been attached for the results.
studied sql in college, just trying to understand.
ReplyDeletewhen you don't use '' in comparison, it seems like you are comparing two columns but not a column with a value. that's why you got the error "Unknown column "tot1" in where clause." when you tried Select * from where tot = tot1
And Select * from where tot = TOT worked because the command interpreter might not be case sensitive.
disclaimer : i am only guessing
hmm may be food for thought , will check about it
ReplyDelete