SQL query: existing values in column

G

Guest

I have a table with 2 columns.

ColumnA ColumnB
apple fruit
ball
cat animal
dog animal
egg
fox animal

What should be my SQL query, if the output that I want are only the rows
with existing values in ColumnB, like this:

ColumnA ColumnB
apple fruit
cat animal
dog animal
fox animal
 
G

Guest

Try this

Select columnA,columnB From TableName Where columnB Is not Null And ColumnB
<> ""
 
G

Guest

in design veiw of the quiry in columnB Criteria type: is not null then all
those ColumnA entries without columnB will not be shown.

Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top