hi Steffan,

i already email you about the null result,
it should be eliminated with a where statement (not including null value)

and about the long time it took,
maybe you shuld add some index to your table...

i suggest

alter table customer add index parents (pid);
alter table customer add index my_id (id);

-leo-
  ----- Original Message ----- 
  From: Steffan A. Cline 
  To: Leo ; [EMAIL PROTECTED] 
  Sent: Monday, November 10, 2003 8:12 PM
  Subject: Re: Complex query woes


  Leo,

      Thanks for the quick reply. There was a typo but I fixed it. Below is
  what I used after correcting it :

  select mgr.company, building.bldgname, tenant.id from customers mgr left
  join customers building on building.pid=mgr.id left join customers tenant on
  tenant.pid=building.id group by mgr.id, building.id, tenant.id order by
  mgr.company, building.bldgname, tenant.company;

  This was closer. Problem now is that it took 6.56 seconds and returned 610
  rows. I have no idea how I now have 610 rows where there are only 279. Any
  thing else you would suggest?




  Thanks

  Steffan

  ---------------------------------------------------------------
  T E L  6 0 2 . 5 7 9 . 4 2 3 0 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
  Steffan A. Cline
  [EMAIL PROTECTED]                             Phoenix, Az
  http://www.ExecuChoice.net                                  USA
  AIM : SteffanC          ICQ : 57234309
  The Executive's Choice in Lasso driven Internet Applications
                                    Lasso Partner Alliance Member
  ---------------------------------------------------------------

Reply via email to