Re: Query is stuck

Поиск
Список
Период
Сортировка
Искать
От
Justin Graf
Тема
Re: Query is stuck
Дата
Msg-id
4BC5CB9D.5050902@magwerks.com
Ответ на
Re: Query is stuck (Bill Moran)
Список
Дерево обсуждения
Query is stuck "Satish Burnwal (sburnwal)" <sburnwal@cisco.com>
Re: Query is stuck Ray Stell <stellr@cns.vt.edu>
Re: Query is stuck "Plugge, Joe R." <JRPlugge@west.com>
Re: Query is stuck "Satish Burnwal (sburnwal)" <sburnwal@cisco.com>
Re: Query is stuck Adrian Klaver <adrian.klaver@gmail.com>
Re: Query is stuck "Plugge, Joe R." <JRPlugge@west.com>
Re: Query is stuck "Satish Burnwal (sburnwal)" <sburnwal@cisco.com>
Re: Query is stuck "Jaiswal Dhaval Sudhirkumar" <JaiswalDS@microland.com>
Re: [ADMIN] Query is stuck Szymon Guz <mabewlun@gmail.com>
Re: [ADMIN] Query is stuck Bill Moran <wmoran@potentialtech.com>
Re: [ADMIN] Query is stuck "Satish Burnwal (sburnwal)" <sburnwal@cisco.com>
Re: [ADMIN] Query is stuck <tv@fuzzy.cz>
Re: Query is stuck "Satish Burnwal (sburnwal)" <sburnwal@cisco.com>
Re: Query is stuck Bill Moran <wmoran@potentialtech.com>
Re: Query is stuck "Satish Burnwal (sburnwal)" <sburnwal@cisco.com>
Re: Query is stuck Bill Moran <wmoran@potentialtech.com>
Re: Query is stuck Justin Graf <justin@magwerks.com>
Re: Query is stuck "Satish Burnwal (sburnwal)" <sburnwal@cisco.com>
Re: Query is stuck Justin Graf <justin@magwerks.com>
On 4/14/2010 9:42 AM, Bill Moran wrote:
>
> Man, it's hard to read your emails.  I've reformatted, I suggest you
> improve the formatting on future emails, as I was about to say "to
> hell with this question" because it was just too difficult to read,
> and I expect there are others on the list who did just that.
>    
I did for the most part.
> select report_id, dm_ip, dm_mac, dm_user,
>         dm_os, report_time, sys_name,
>         sys_user, sys_user_domain, ss_key,
>         login_time, role_id, new_vlan_id
>    from repcopy as a
>    where report_time = (
>      select max(report_time) from repcopy as b
>        where a.dm_user=b.dm_user and a.dm_ip = b.dm_ip and b.ss_key != ''
>        )
>      and report_status = 0 and dm_user = 'u3';
>
>    
I suggest writting something like this.

select report_id, dm_ip, dm_mac, dm_user,
        dm_os, report_time, sys_name,
        sys_user, sys_user_domain, ss_key,
        login_time, role_id, new_vlan_id
   from repcopy as a
	(select max(report_time) as rtime, 	
  			dm_user, dm_ip
		from repcopy
		group by dm_user, dm_ip
		where ss_key != '') as materialized
   where report_time = materialized.rtime
    and materialized.dm_user = a.dm_user
    and materialized.dm__ip = a_ip
    and report_status = 0
    and dm_user = 'u3';




All legitimate Magwerks Corporation quotations are sent in a .PDF file attachment with a unique ID number generated by our proprietary quotation system. Quotations received via any other form of communication will not be honored.

CONFIDENTIALITY NOTICE: This e-mail, including attachments, may contain legally privileged, confidential or other information proprietary to Magwerks Corporation and is intended solely for the use of the individual to whom it addresses. If the reader of this e-mail is not the intended recipient or authorized agent, the reader is hereby notified that any unauthorized viewing, dissemination, distribution or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and destroy all occurrences of this e-mail immediately.
Thank you.

В списке pgsql-general по дате отправления
От: Merlin Moncure
Дата:
От: akp geek
Дата:
FAQ