Re: [PLUG] MSQL Cross-Table Query

2010-03-03 Thread Carlos Konstanski
Am 03.03.2010 08:12, schrieb Randal L. Schwartz: >> "D" == D Cooper Stevenson writes: > > D> I have three tables entitled, "msft," "goog," "aapl," and "intc." Each > D> of these tables are in the same database entitled, "minute." > > Tables with the same structure with different names are an

Re: [PLUG] MSQL Cross-Table Query

2010-03-03 Thread Randal L. Schwartz
> "D" == D Cooper Stevenson writes: D> I have three tables entitled, "msft," "goog," "aapl," and "intc." Each D> of these tables are in the same database entitled, "minute." Tables with the same structure with different names are an indication that you're confusing data with structure. In t

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread Aaron Burt
On Tue, Mar 02, 2010 at 01:13:51PM -0800, Tim Garton wrote: *applause* Sorry for idle chatter, but I just wanted to point out Tim's excellent and well-thought-out response, and strongly recommend it to Cooper. ___ PLUG mailing list PLUG@lists.pdxlinux

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread Tim Garton
If you know for sure that you are going to have data for every minute and never duplicate data, and that the `time` column will always be 0 seconds, something like: select m.`date`, m.`time`, m.`close`, g.`close`, a.`close`, i.`close` from msft m join goog g on g.`date` = m.`date` and g.`time` = m

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread Rich Shepard
On Tue, 2 Mar 2010, D. Cooper Stevenson wrote: > No way did I give up on you guys! I'll post a solution once I've struck > it. I'm seeing a lot of good feedback here--in fact I'm getting so much > that I have much to go through, keep it up! Coop, Rick van der Lans' book, "Introduction to SQL,

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread D. Cooper Stevenson
On 03/02/10 09:40, Aaron Burt wrote: > On Tue, Mar 02, 2010 at 08:14:57AM -0800, D. Cooper Stevenson wrote: > >> I wrote, successfully, a "date/time" query based on the tick data some >> time ago. I suspected, through my reading of the documentation, that the >> "narrowing of the fields--" so t

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread D. Cooper Stevenson
On 03/02/10 10:29, Michael wrote: > OK, I see your use and you are doing what you want. > > However... > > On any given day for a particular equity the opening price is a single > value. > The opening price does not change through the day. It was > fixed at the first trade of the day. > The o

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread Michael
D. Cooper Stevenson wrote: > Hi Michael, > > On 03/02/10 06:03, Michael Rasmussen wrote: >> Are these real samples? You seem to have a problem with data integrity. >> >> > We're alright, see below. >> (And do you really want to monitor minute by minute price flucuations?) > Yes, you may view a

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread Aaron Burt
On Tue, Mar 02, 2010 at 08:14:57AM -0800, D. Cooper Stevenson wrote: > I wrote, successfully, a "date/time" query based on the tick data some > time ago. I suspected, through my reading of the documentation, that the > "narrowing of the fields--" so to speak--would be more complex than a > simple

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread Carlos Konstanski
Am 02.03.2010 09:49, schrieb Carlos Konstanski: > Am 02.03.2010 01:09, schrieb D. Cooper Stevenson: >> Hello Everyone, >> >> I've worked through the documentation but haven't yet worked out a >> cross-table query in MYSQL yielding the correct results. My goal is to >> pull data from four tables tha

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread Carlos Konstanski
Am 02.03.2010 09:49, schrieb Carlos Konstanski: > Am 02.03.2010 01:09, schrieb D. Cooper Stevenson: >> Hello Everyone, >> >> I've worked through the documentation but haven't yet worked out a >> cross-table query in MYSQL yielding the correct results. My goal is to >> pull data from four tables tha

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread Carlos Konstanski
Am 02.03.2010 01:09, schrieb D. Cooper Stevenson: > Hello Everyone, > > I've worked through the documentation but haven't yet worked out a > cross-table query in MYSQL yielding the correct results. My goal is to > pull data from four tables that correspond to the date-time stamp of the > first tab

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread Tim
> I wrote, successfully, a "date/time" query based on the tick data some > time ago. I suspected, through my reading of the documentation, that the > "narrowing of the fields--" so to speak--would be more complex than a > simple WHERE statement. Glad you were able to get it working. I would sug

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread D. Cooper Stevenson
Hi Michael, On 03/02/10 06:03, Michael Rasmussen wrote: > Are these real samples? You seem to have a problem with data integrity. > > We're alright, see below. > (And do you really want to monitor minute by minute price flucuations?) Yes, you may view a screenshot depicting my utilization of th

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread drew wymore
On Tue, Mar 2, 2010 at 7:36 AM, Rich Shepard wrote: > On Tue, 2 Mar 2010, Patrick J. Timlick wrote: > >> select m.close, a.close, g.close, i.close from msft m, aapl a, goog g, >> intc i where date = "$date" and time = "$time" >> >> I don't think this works because date and time are ambiguous; they

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread Rich Shepard
On Tue, 2 Mar 2010, Patrick J. Timlick wrote: > select m.close, a.close, g.close, i.close from msft m, aapl a, goog g, > intc i where date = "$date" and time = "$time" > > I don't think this works because date and time are ambiguous; they could be > from any of the 4 tables. Yup. If the da

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread Patrick J. Timlick
select m.close, a.close, g.close, i.close from msft m, aapl a, goog g, intc i where date = "$date" and time = "$time" I don't think this works because date and time are ambiguous; they could be from any of the 4 tables. When you write a join without join criteria the transitive closure of all row

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread Michael Rasmussen
On Tue, Mar 02, 2010 at 12:09:36AM -0800, D. Cooper Stevenson wrote: > Here is an example of each (they're essentially the same): Are these real samples? You seem to have a problem with data integrity. (And do you really want to monitor minute by minute price flucuations?) > msft: > > date

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread drew wymore
On Tue, Mar 2, 2010 at 12:20 AM, drew wymore wrote: > On Tue, Mar 2, 2010 at 12:09 AM, D. Cooper Stevenson > wrote: >> Hello Everyone, >> >> I've worked through the documentation but haven't yet worked out a >> cross-table query in MYSQL yielding the correct results. My goal is to >> pull data fr

Re: [PLUG] MSQL Cross-Table Query

2010-03-02 Thread drew wymore
On Tue, Mar 2, 2010 at 12:09 AM, D. Cooper Stevenson wrote: > Hello Everyone, > > I've worked through the documentation but haven't yet worked out a > cross-table query in MYSQL yielding the correct results. My goal is to > pull data from four tables that correspond to the date-time stamp of the >

[PLUG] MSQL Cross-Table Query

2010-03-02 Thread D. Cooper Stevenson
Hello Everyone, I've worked through the documentation but haven't yet worked out a cross-table query in MYSQL yielding the correct results. My goal is to pull data from four tables that correspond to the date-time stamp of the first table. This will make sense as I describe what I am trying to pul