I am having difficulty retrieving basic data in a query.
I have a relation with three columns, an id which is an INT and PRIMARY KEY and I have two more columns that are VARCHAR(30) called fname and lname.
I cannot get my basic query to work when asking for people by name. I can get my query to work when asking by id.
for example:
select * from customers where cid = 2; -- Does work :)
and
select * from customers where fname = 'Bob'; -- Does not work :(
I’ve also tried many variations with different quotation makes like the double quote and the key above the tab key. And yes, there is a record with the name Bob
Can anyone help me out with what I am doing wrong?
There is a reasonable possibility that the field doesn’t contain the word ‘Bob’ without whitespace (spaces, tabs, carriage returns, etc) or perhaps it was put in the ‘lname’ field accidentally. Try:
and check any results for extra whitespace.