Hi Will,

If you're trying to join two tables, you need a common column (field) in
both tables.
E.g. to join Invoice table to Invoice_Details you would have a common field
Invoice_nbr in both tables.

The WHERE clause in SQL tells the database engine to only return the rows
meeting your criteria.  This is much more efficient than you doing a "run
through" the entire table searching for something.

If I understand your example (which I might not <grin>) you would need to
have the column zapSearch in both the tables zap and advert_details.

You said "this is out of my depth" -- you might benefit from a good
beginning book on SQL.  I really like Ben Forta's "Teach Yourself SQL in 10
Minutes" by Sams, ISBN 0-672-31664-1, US $12.99.  It has a lot of material
on why and how to join tables.

HTH.

Ben

-----Original Message-----
From: W Luke [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 1:12 PM
To: CF-Talk
Subject: Query join problem


Hi,

Not sure what I need to do for this - hope someone can help.

After someone posts an advert, it's entered into the database table
advert_details.  A table called zap contains 2 fields, zapSearch and
zapEmail, with zapSearch being a search string.  After posting the advert, I
need to run through zapSearch to search for the text in the just-posted
advert.  If it finds anything, send an email to zapEmail.

I just can't fathom how to do this.  The fields in advert_details we're
worried about are body and subject.  I've had a go, but this is out of my
depth.  Can anyone help?

Thanks

Will
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to