Solved

MySQL SQL Syntax question exclude data

Posted on 2008-06-18
2
746 Views
Last Modified: 2013-12-12
I am using the following SQL query to pull matching data.  Some of the results may not have data for fields sLatitude and sLongitude.  How do I exclude these records when these fields are empty in my SQL query?
SELECT * FROM Residential, property_coordinates

        WHERE sSubdivision='Pines'

        AND Residential.sMLSNumber=property_coordinates.sMLSNumber

Open in new window

0
Comment
Question by:pda4me
2 Comments
 
LVL 22

Assisted Solution

by:dportas
dportas earned 50 total points
ID: 21812645
Assuming that "empty" means "null", do:

SELECT *
        FROM Residential, property_coordinates
        WHERE sSubdivision='Pines'
        AND Residential.sMLSNumber=property_coordinates.sMLSNumber
        AND sLatitude IS NOT NULL
        AND sLongitude IS NOT NULL ;
0
 
LVL 4

Accepted Solution

by:
albuitra earned 450 total points
ID: 21812660
Try with this
SELECT * FROM Residential, property_coordinates

        WHERE sSubdivision='Pines'

        AND Residential.sMLSNumber=property_coordinates.sMLSNumber

AND sLatitude is not NULL and sLatitude != '' 

and sLongitude is not NULL and sLongitude != ''

Open in new window

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How can I do this in Pyhton? 12 71
Select2 jquery help 9 45
Jquery Autocomplete PHP script 3 21
Error installing extension Linux 4 30
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

706 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now