Well... I can't figure out how to use the "order_by" column
I've put into each real estate office table.

Let's say (to make this simpler) that I've got six tables.

1 - hmls_offices
2 - hmls_lots
3 - hmls_homes

4 - smlc_offices
5 - smlc_lots
6 - smlc_homes

The hmls_offices and smlc_offices tables both have a
display_order column for each office.

For my client's display_order column, I give the first office a '1'
and the second office an order of '2' and the remaining offices are null.

How would I use that column with these different select statements?
(These are shortened to make this simple to work with...)

select hl.property_id as prop_id from hmls_lots hl
union all
select sl.property_id as prop_id from smlc_lots sl
union all
select hh.property_id as prop_id from hmls_homes hh
union all
select sh.property_id as prop_id from smlc_homes sh

order by "the display_order number for each office" ???

Would it be better to run a first query to get the office_id's,
order that by display_order, then loop that query with the "get_properties"
query inside?  (I tried a version of that and my "get_properties" query,
which was running in about 2 seconds for 7,000 properties, suddenly bogged
down so badly the browser timed out...)

I'm beginning to think that I might be better off just combining
the data from the two data providers into the same tables, instead of
separating them by property type as they do, and keeping the data separate
by the data provider, as I have so far.

Thoughts, anyone?

Rick




> -----Original Message-----
> From: Rick Faircloth [mailto:[EMAIL PROTECTED]
> Sent: Saturday, May 17, 2008 8:28 PM
> To: CF-Talk
> Subject: RE: How do I use "order by" for this?
> 
> I was until last week.  :o)
> 
> Thanks, Will!
> 
> 
> 
> > -----Original Message-----
> > From: Will Tomlinson [mailto:[EMAIL PROTECTED]
> > Sent: Saturday, May 17, 2008 8:23 PM
> > To: CF-Talk
> > Subject: Re: How do I use "order by" for this?
> >
> > >Is there a way to do this in the code or should I just add
> > >an "order_by" field to the db (MySQL 5) and just put 1
> > >in their field and leave everyone else's field null?  (This
> > >sounds reasonable and simple enough)
> > >
> > >Thoughts?
> >
> > Dude, I've hadda few long islands tnight, but I'd use an orderby field like 
> > you say.
Quick'n'easy
> > ('n'Dirty)
> >
> > (Figured you were probably on MySQL 2)   :)
> >
> > Will
> 
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305583
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to