Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 628
  • Last Modified:

POSTGRESQL Testing for and selecting only NOT NULL records

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
Maritimed
Asked:
Maritimed
  • 2
1 Solution
 
Dan CraciunIT ConsultantCommented:
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
 
MaritimedAuthor Commented:
Thanks, exactly what I was looking for!
0
 
Dan CraciunIT ConsultantCommented:
Glad I could help!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now