Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Making grouped dql's - but without grouping... perhaps some sort of self join?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Skt. Hans  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 13:05
From: "Skt. Hans" <tafkaner...@gmail.com>
Date: Thu, 5 Nov 2009 05:05:09 -0800 (PST)
Local: Thurs 5 Nov 2009 13:05
Subject: Making grouped dql's - but without grouping... perhaps some sort of self join?
Hi

I have been strugling with a problem for quite some time.

I have a model like this (see below).

I usually make a list where i get stocks from a certain broker.

But now i would like to make a list with one stock only (the same
stock_id (stock_id = 13)) and then the price values for each broker.
This will allow me to see the same stock all the way down the list,
but different broker properties and different prices (note that each
broker has its own price pr. stock).

Normal output (the way i use it now)
Array(
-->Stock (id:1)
---->Prices
---->Quotes,
-->Stock (id:2)
---->Prices
---->Quotes
)

Requested output (the i want it also to be - normal output should not
break)
Array(
Broker (id:SFD)(
-->Stock (id:2)
---->Prices
---->Quotes
),
Broker (id:SRE)(
-->Stock (id:2)
---->Prices
---->Quotes
),
Broker (id:SRE)(
-->Stock (id:2)
---->Prices
---->Quotes
)
)

I was recently considering building my requested model myself, but i
assume that doctrine easily could do the job for me.

If my question is unclear in any way, please let me know and let my
try to explain further.

Thanks!

YAML:

Broker:
  tableName: broker
  columns:
    id:
      type: string(20)
      primary: true
    name: string(255)
    prices_updated: timestamp
  relations:
    Stocks:
      class: Stock
      local: id
      foreign: stock_id
      type: many
    Prices:
      class: Price
      local: id
      foreign: broker_id
      type: many
  indexes:
    broker_id_index:
      fields: [id]

Price:
  tableName: price
  columns:
    id:
      type: integer(8)
      autoincrement: true
      primary: true
    date: date(25)
    date_short: date(25)
    stock_id: integer(5)
    broker_id: integer(5)
    trades: integer(9)
    nettobuy: decimal(18)
    avgbuy: decimal(18)
    avgsell: decimal(18)
    turnover: decimal(18)
    shares_total: integer(9)
    shares_buy: integer(9)
    shares_sell: integer(9)
    shares_internal: integer(9)
    shares_netto: integer(9)
  relations:
    Stock:
      local: stock_id
      foreign: id
      type: one
    Broker:
      local: broker_id
      foreign: id
      type: one
  indexes:
    price_dateindex:
      fields: [date_short]
    price_stockindex:
      fields: [stock_id]

Stock:
  tableName: stock
  columns:
    id:
      primary: true
      type: integer(5)
    name: string(255)
    exchange: string(50)
  relations:
    Prices:
      class: Price
      local: id
      foreign: stock_id
      type: many
    Quotes:
      class: Quote
      local: id
      foreign: stock_id
      type: many
  indexes:
    stock_idindex:
      fields: [id]

Quote:
  tableName: quote
  columns:
    stock_id: integer(5)
    date: date(25)
    date_short: date(25)
    price: decimal(18)
    turnover: decimal(18)
    amount: integer(9)
    high: decimal(18)
    low: decimal(18)
    provider: string(10)
  relations:
    Stock:
      class: Stock
      local: stock_id
      foreign: id
      type: one
  indexes:
    quote_dateindex:
      fields: [date_short]
    quote_stockindex:
      fields: [stock_id]


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark E. Haase  
View profile   Translate to Translated (View Original)
 More options 6 Nov, 17:19
From: "Mark E. Haase" <meha...@gmail.com>
Date: Fri, 6 Nov 2009 09:19:29 -0800 (PST)
Local: Fri 6 Nov 2009 17:19
Subject: Re: Making grouped dql's - but without grouping... perhaps some sort of self join?
You're thinking of "Sort"

On Nov 5, 8:05 am, "Skt. Hans" <tafkaner...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google