Problem with NULL queries...

19 views
Skip to first unread message

Jim R

unread,
Sep 28, 2011, 11:29:21 AM9/28/11
to Sequel Pro
The query in question is:

Select * From fallLeague10 Where paid!="y"

So I'm trying to get all the rows which haven't paid yet. All it's
returning are those which have been marked with something other than a
p, like d for discount or f for free. It's also returning empty ones,
which are four rows where I made changes manually.

There are 40 rows or so that are marked as NULL when you look at the
content view. I've even tried that query with:

...or NULL
...or IS NULL


Jakob Egger

unread,
Sep 29, 2011, 3:18:02 AM9/29/11
to seque...@googlegroups.com

Try

> SELECT * FROM fallLeague10 WHERE paid != "y" OR paid IS NULL

> --
> You received this message because you are subscribed to the Google Groups "Sequel Pro" group.
> To post to this group, send email to seque...@googlegroups.com.
> To unsubscribe from this group, send email to sequel-pro+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sequel-pro?hl=en.
>

Larry D. Wilson

unread,
Sep 28, 2011, 12:46:57 PM9/28/11
to seque...@googlegroups.com
Try

select * from fallLeague10 where ifnull(paid,'y') = 'y';

And never use "select *" in production ;-)

Larry D. Wilson
NorthP...@gmail.com
817.412.9433 Cell

"If you think education is expensive, try ignorance."
– James Armstrong, Birmingham, Alabama

Reply all
Reply to author
Forward
0 new messages