> Also, I produced a second query using PostgreSQL:
> select a.id_i, a.ir_id, a.test, a.stamp
> from test a
> join
> (
> select max(stamp) as mstamp, id_i
> from test
> group by id_i
> ) b
> on a.stamp = b.mstamp
> where a.test = false
> ;
> -- result
> id_i | ir_id | test |stamp
> --
> i think i've figured out the gist of the thought
> process behind the SQL query...
>
> 1. select everything from t_inspect_result as table a
> 2. select max timestamp value entries in
> t_inspect_result as table b
> 3. choose only choose those rows where the max
> timestamps of table a and b are
> > Richard,
> >
> > i got the expected rewsults! now i just have to
> study
> > the query to figure out what it does. -lol-
> >
> > i tried using AS, but i only did it in one place -
> > doh! the error message just moved to the next
> place i
> > didn't do it. i'll know better next time.
> >
> Richard,
>
> i got the expected rewsults! now i just have to study
> the query to figure out what it does. -lol-
>
> i tried using AS, but i only did it in one place -
> doh! the error message just moved to the next place i
> didn't do it. i'll know better next time.
>
> thanks for the hel
> > yields the following error:
> >
> > ERROR: schema "a" does not exist
> >
> > i tried to interpret you query and apply it to my
> > case, but, apparently, i didn't too good of a job.
> >
> > do you see the error?
>
> Hmmm... That is strange. but according to the
> PostgreSQL documentation
> yields the following error:
>
> ERROR: schema "a" does not exist
>
> i tried to interpret you query and apply it to my
> case, but, apparently, i didn't too good of a job.
>
> do you see the error?
Hmmm... That is strange. but according to the PostgreSQL documentation on
select you can add
--- Richard Broersma Jr <[EMAIL PROTECTED]> wrote:
> > Richard, that is the result i would need given
> that
> > data set. i have to digest this version, though.
> >
> > should this query be more efficient than the
> subquery
> > version as the table starts to get large?
>
> My experience is th
> Richard, that is the result i would need given that
> data set. i have to digest this version, though.
>
> should this query be more efficient than the subquery
> version as the table starts to get large?
My experience is that Distinct On queries do not preform as well as their group
by count
> > an inspection node (each row in t_inspect is an
> > inspection node) that has passed can't have a new
> > defect added - since it has already passed.
> >
> > therefore, in the defect entry form, i only want
> to
> > display those inspection nodes that don't have a
> true
> > value. by defin
> an inspection node (each row in t_inspect is an
> inspection node) that has passed can't have a new
> defect added - since it has already passed.
>
> therefore, in the defect entry form, i only want to
> display those inspection nodes that don't have a true
> value. by definition, a true valu
> > inspect_id, inspect_result_id,
> inspect_result_pass,
> > inspect_result_timestamp
> > 3, 5, f, 2006-06-05 05:00:00
> > 3, 6, t, 2006-06-05 06:00:00
> > 4, 7, f, 2006-06-05 07:00:00
> > *4, 8, f, 2006-06-05 08:00:00*
> > the query linked in this post will return 3
> lines...
> >
> > 1, 2, f
>
> inspect_id, inspect_result_id, inspect_result_pass,
> inspect_result_timestamp
> 3, 5, f, 2006-06-05 05:00:00
> 3, 6, t, 2006-06-05 06:00:00
> 4, 7, f, 2006-06-05 07:00:00
> *4, 8, f, 2006-06-05 08:00:00*
> the query linked in this post will return 3 lines...
>
> 1, 2, f
> 3, 5, f
> *4, 8, f* --
> > > how can i exclude true values for this query?
> > >
> > > http://www.rafb.net/paste/results/obtkGz26.html
> > >
> > > if i uncomment out
> > >
> > > --AND t_inspect_result.inspect_result_pass =
> 'f'
> > >
> > > it looks for prior falses within an inspect_id
> and
> > > returns it.
> > how can i exclude true values for this query?
> >
> > http://www.rafb.net/paste/results/obtkGz26.html
> >
> > if i uncomment out
> >
> > --AND t_inspect_result.inspect_result_pass = 'f'
> >
> > it looks for prior falses within an inspect_id and
> > returns it. i want the original res
> > hi all,
> >
> > how can i exclude true values for this query?
> >
> > http://www.rafb.net/paste/results/obtkGz26.html
> >
> > if i uncomment out
> >
> > --AND t_inspect_result.inspect_result_pass =
> 'f'
> >
> > it looks for prior falses within an inspect_id and
> > returns it. i wan
> hi all,
>
> how can i exclude true values for this query?
>
> http://www.rafb.net/paste/results/obtkGz26.html
>
> if i uncomment out
>
> --AND t_inspect_result.inspect_result_pass = 'f'
>
> it looks for prior falses within an inspect_id and
> returns it. i want the original result set
hi all,
how can i exclude true values for this query?
http://www.rafb.net/paste/results/obtkGz26.html
if i uncomment out
--AND t_inspect_result.inspect_result_pass = 'f'
it looks for prior falses within an inspect_id and
returns it. i want the original result set minus the
trues, if poss
17 matches
Mail list logo