Skip to Main Content

Japanese

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

連続する項目の件数をカウントするには?

1049968Oct 23 2013 — edited Nov 11 2013

以下のようなデータが存在する時、
A列、B列でソートし、C列が連続する行の先頭レコードを取得し、連続する項目の件数をカウントすることは可能でしょうか?


【テーブル】

A    B    C  
---- ---- ----
500  1    A
500  2    A
500  3    B
500  4    B
500  5    A
600  1    A
600  2    A
600  3    B

【取得したい結果】
A    B    C    Count
---- ---- ---- ----
500  1    A    2
500  3    B    2
500  5    A    1
600  1    A    2
600  3    B    1

A列、B列でソートし、C列が連続する行の先頭レコードを取得するところまではできたのですが、
件数をカウントする方法が思いつきません。

SELECT A,B,C
FROM(SELECT A,B,C
        ,NVL(lag(C) over (partition by A order by B),'X' ) AS LAST_A
        FROM テーブル)
WHERE C <> LAST_A

もし良い知恵があれば教えてください。
よろしくお願いします。

Oracle 10g

This post has been answered by Aketi Jyuuzou on Oct 26 2013
Jump to Answer

Comments

Billy Verreynne

A session is the logical entity that services a specific db client connection.
A process is the physical entity that executes a session.
With dedicated server, each session has its own physical process for execution. 1:1 relationship. A 100 sessions mean a 100 processes.
With shared server, sessions share a pool of processes, where any idle process can be tasked to execute any shared server session. A 100 processes in the pool can service a 1000 shared sessions. However, if all 100 processes are busy, then 900 sessions need to wait for an idle process in order to to be serviced.

sol-danesh

And What is the method of setting these two parameters in Oracle architectures?

sol-danesh

Thank you dear Billy Verreynne.
As a result, it can be said that dedicated architecture is better for projects with a large number of users?

Billy Verreynne

Basic parameters for shared server are DISPATCHERS and SHARED_SERVERS.
Shared Server is ideal for supporting a large number of OLTP type users, servicing 1000s of user requests that are of short duration to service. Note that UGA memory is stored in the SGA.
Dedicated Server is ideal for supporting OLAP type users, servicing 100s of user requests that are of long duration to service. Note that UGA memory is stored in the PGA.
The Oracle database can use both architectures at the same time.

1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 9 2013
Added on Oct 23 2013
8 comments
10,719 views