LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   General (https://www.linuxquestions.org/questions/general-10/)
-   -   A Simple MySQL Query Question (I have Bad Syntax) (https://www.linuxquestions.org/questions/general-10/a-simple-mysql-query-question-i-have-bad-syntax-122124/)

bpk 12-02-2003 08:50 PM

A Simple MySQL Query Question (I have Bad Syntax)
 
Im re-new to MySQL (haven't touched it in years) and am trying to display email addressed from a database table who's zip code begins with a "94". The Database is named 'mailinglist' and the table with the data is 'maillist'

So I think something like this would work;

Code:

SELECT `PrimaryEmail` FROM 'maillist' WHERE `PrimaryZip` = '94%'
but thats a negative. I've been checking the MySQL.com docs and haven't found examples of what I need.

bpk 12-02-2003 09:04 PM

Figured it out. And for archival purposes, here is my solution;

Code:

SELECT PrimaryEmail FROM maillist WHERE PrimaryZip LIKE '94%';


All times are GMT -5. The time now is 11:43 PM.