1

I'm using the Firefox sqlite manager addon and I have a database table named - drinktable. I need to extract all the columns where the title matches a certain string. This is the query I am running right now -

SELECT * FROM drinktable where title = 'First Drink';

But it won't return anything. It just shows the 4 columns in the database, but nothing in those columns. Can someone please tell me why ?

2
  • 1
    Could it be because no row in first contains 'First Drink' in the drinktable column? Commented Jun 29, 2012 at 4:31
  • I made a typo while typing the question. Fixed that. Commented Jun 29, 2012 at 4:39

1 Answer 1

3

I have a database table named - drinktable.

One thing in your question. Your table name is drinktable and you are querying against first, is it a typo. In SQL Select statement you specify table name after from and column name in where clause

SELECT * FROM drinktable where first = 'First Drink'; Select * from <TableName> where <ColumnName> = 'Value to compare'; 

If your table name is first and column name is drinktable then chances are that there are now row(s) with column drinktable set to 'First Drink'. You might have spaces or some other characters. Try

SELECT * FROM first where drinktable like '%First Drink%'; 

EDIT:

Based on your edited question, chances are you have spaces or some other characters, try:

SELECT * FROM drinktable where title like '%First Drink%'; 
Sign up to request clarification or add additional context in comments.

1 Comment

I made a typo while typing the question. Fixed that.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.