Solved

POSTGRESQL Testing for and selecting only NOT NULL records

Posted on 2014-03-10
3
577 Views
Last Modified: 2014-03-10
I am new to Postgresql and am struggling with how to test for NOT null records. I'm using ODBC from within VFP as follows:

SQLEXEC(connhndl,"select id as shipid,name as shipto,city as shipcity, state_id from res_partner where not null state_id","shipto")

What is the correct syntax to achieve this?
0
Comment
Question by:Maritimed
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
Dan Craciun earned 500 total points
ID: 39917740
SELECT id AS shipid, name AS shipto, city AS shipcity, state_id
FROM res_partner
WHERE state_id IS NOT NULL

http://www.postgresql.org/docs/8.1/static/functions-comparison.html

HTH,
Dan
0
 

Author Closing Comment

by:Maritimed
ID: 39917937
Thanks, exactly what I was looking for!
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39917942
Glad I could help!
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Migrating from SQL Server to Postgres advice 5 95
Getting from database to make one row 17 82
Fox pro conversion 3 77
Where to place postgres JDBC driver jar on tomcat 8 24
Best database to use for Maps is PostgreSQL. This is an open source database. Comes as a package with most Linux OS. For more info visit the following site: http://www.postgresql.org/ (http://www.postgresql.org/) This requires some add-o…
Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question