How to identify primary email addresses

It’s easy enough to write a query to find email address records in GoldMine. This simple one does the job:

select * from contsupp where contact='e-mail address'

However, if we want to limit the results to just primary addresses then we also need to look at the flags that are held in the Zip field. A ‘1’ in the second position is the marker that we are looking for and so we can use SQL’s single-character wildcard (an underscore) to find that:

select * from contsupp where contact='e-mail address' and contsupp.zip like '_1__'