RE: How to write this query?

2008-04-13 Thread Rick Faircloth
To: CF-Talk > Subject: Re: How to write this query? > > On Sun, Apr 13, 2008 at 8:27 AM, Kris Jones <[EMAIL PROTECTED]> wrote: > > How about something like: > > > > select sa.street_number, sa.street_name, sa.city, > > sa.public_remarks_01, sa.public_

Re: How to write this query?

2008-04-13 Thread Jim Wright
On Sun, Apr 13, 2008 at 8:27 AM, Kris Jones <[EMAIL PROTECTED]> wrote: > How about something like: > > select sa.street_number, sa.street_name, sa.city, > sa.public_remarks_01, sa.public_remarks_02, sa.public_remarks03, > sa.list_price, > (select top 1 sap.photo_filename from smlc_acr_photos sa

Re: How to write this query?

2008-04-13 Thread Kris Jones
How about something like: select sa.street_number, sa.street_name, sa.city, sa.public_remarks_01, sa.public_remarks_02, sa.public_remarks03, sa.list_price, (select top 1 sap.photo_filename from smlc_acr_photos sap where sap.photo_mls_number = sa.mls_number) as photo_filename from smlc_acr sa order

Re: How to write this query?

2008-04-13 Thread [STS] Ravi Gehlot
ame, > > sap.photo_mls_number from smlc_acr_photos sap ' at line 4" > > > > I can't see the error in my syntax. But then, again, I'm not the > > most experienced "join writer", having avoided them when I could. > > > > Tha

Re: How to write this query?

2008-04-13 Thread [STS] Ravi Gehlot
p.photo_mls_number from smlc_acr_photos sap ' at line 4" > > I can't see the error in my syntax. But then, again, I'm not the > most experienced "join writer", having avoided them when I could. > > Thanks, again. > > Rick > > > -----Or

RE: How to write this query?

2008-04-13 Thread Rick Faircloth
ED] > Sent: Sunday, April 13, 2008 1:45 AM > To: CF-Talk > Subject: Re: How to write this query? > > something like the following (note: mysql syntax): > > SELECT sa.street_number, sa.street_name, sa.city, sa.public_remarks_01, > sa.public_remarks_02, sa.public_remarks_0

Re: How to write this query?

2008-04-12 Thread Azadi Saryev
something like the following (note: mysql syntax): SELECT sa.street_number, sa.street_name, sa.city, sa.public_remarks_01, sa.public_remarks_02, sa.public_remarks_03, sa.list_price, SAP_SQ.photo_filename FROM smlc_acr sa INNER JOIN (SELECT photo_filename, photo_mls_number FROM smlc_acr_photos sap

How to write this query?

2008-04-12 Thread Rick Faircloth
Hi, all... I've got two tables: 1 - list of properties 2 - photos for those properties There is more than one photo per property. What I want to do is get each property and the first photo for that property. Here's what I've tried: select distinct sa.street_number, sa.street_name, sa.