Click here to Skip to main content
15,746,064 members
Home / Discussions / Database
   

Database

 
Questionget the record identity from PostgreSQ/ Pin
Jassim Rahma28-Oct-10 4:57
Jassim Rahma28-Oct-10 4:57 
AnswerRe: get the record identity from PostgreSQ/ Pin
Chris Meech28-Oct-10 5:16
Chris Meech28-Oct-10 5:16 
AnswerRe: get the record identity from PostgreSQ/ Pin
David Skelly28-Oct-10 22:35
David Skelly28-Oct-10 22:35 
QuestionPivot? Pin
mark_w_28-Oct-10 3:08
mark_w_28-Oct-10 3:08 
AnswerRe: Pivot? Pin
Goutam Patra28-Oct-10 3:18
professionalGoutam Patra28-Oct-10 3:18 
GeneralRe: Pivot? Pin
mark_w_28-Oct-10 3:24
mark_w_28-Oct-10 3:24 
GeneralRe: Pivot? Pin
Goutam Patra28-Oct-10 3:35
professionalGoutam Patra28-Oct-10 3:35 
AnswerRe: Pivot? Pin
David Mujica28-Oct-10 4:19
David Mujica28-Oct-10 4:19 
Do I understand that both your sites (A,B,C) and your attributes (X,Y,Z) are variable in number ? And you are counting some sort of occurrence ?

My pivot tables show the months across the top, the salesman down the left and the number in the grid represents the number of orders closed in that month. Sound familiar ?

Your Pivot might look something like this:

select Salesman, [1] as Jan,[2] Feb,[3] Mar,[4] Apr,[5] May,[6] Jun,<br />
    [7] Jul, [8] Aug, [9] Sep, [10] Oct, [11] Nov, [12] Dec<br />
from (<br />
select salesman, OrderID, datepart(month,order_date) as month<br />
from orders<br />
where datepart(year,order_date) = 2010)<br />
AS SourceTable<br />
PIVOT (COUNT(OrderID) FOR month in ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12])) AS PivotTable

GeneralRe: Pivot? Pin
mark_w_28-Oct-10 4:25
mark_w_28-Oct-10 4:25 
AnswerRe: Pivot? Pin
Mycroft Holmes28-Oct-10 13:56
professionalMycroft Holmes28-Oct-10 13:56 
GeneralRe: Pivot? Pin
mark_w_28-Oct-10 21:42
mark_w_28-Oct-10 21:42 
GeneralRe: Pivot? Pin
Mycroft Holmes28-Oct-10 22:20
professionalMycroft Holmes28-Oct-10 22:20 
GeneralRe: Pivot? Pin
mark_w_28-Oct-10 22:32
mark_w_28-Oct-10 22:32 
GeneralRe: Pivot? Pin
Jörgen Andersson28-Oct-10 23:26
professionalJörgen Andersson28-Oct-10 23:26 
GeneralRe: Pivot? Pin
mark_w_29-Oct-10 4:28
mark_w_29-Oct-10 4:28 
GeneralRe: Pivot? Pin
Jörgen Andersson29-Oct-10 5:42
professionalJörgen Andersson29-Oct-10 5:42 
GeneralRe: Pivot? Pin
Mycroft Holmes29-Oct-10 0:27
professionalMycroft Holmes29-Oct-10 0:27 
Questionzip file Pin
tan87327-Oct-10 23:42
tan87327-Oct-10 23:42 
AnswerRe: zip file Pin
Simon_Whale28-Oct-10 5:13
Simon_Whale28-Oct-10 5:13 
GeneralRe: zip file Pin
jschell28-Oct-10 8:11
jschell28-Oct-10 8:11 
AnswerRe: zip file Pin
jschell28-Oct-10 8:14
jschell28-Oct-10 8:14 
QuestionCheck the database for existency. Pin
T.RATHA KRISHNAN27-Oct-10 21:30
T.RATHA KRISHNAN27-Oct-10 21:30 
AnswerRe: Check the database for existency. Pin
Andy_L_J27-Oct-10 21:50
Andy_L_J27-Oct-10 21:50 
QuestionRe: Check the database for existency. [modified] Pin
T.RATHA KRISHNAN28-Oct-10 0:14
T.RATHA KRISHNAN28-Oct-10 0:14 
AnswerRe: Check the database for existency. Pin
jschell28-Oct-10 8:22
jschell28-Oct-10 8:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.