That's getting too complicated. It can be done simply as:
SELECT DISTINCT(test.people.id) test.people.id, test.people.name, test.likes.ref
FROM test.people LEFT JOIN test.likes ON test.people.id = test.likes.ref
ORDER BY test.people.id, test.likes.date DESCENDING
Assuming people.id is unique, the
* Andrew E. Tegenkamp wrote:
I have two tables and want to attach and return the most recent data from
the second table.
Table 1 has a counter ID and name. Table 2 has a counter ID, Reference (to
Table 1 ID), Date, and Like. I want to do a query that gets each name and
their most recent like. I
Andrew E. Tegenkamp wrote:
I have two tables and want to attach and return the most recent data from
the second table.
Table 1 has a counter ID and name. Table 2 has a counter ID, Reference (to
Table 1 ID), Date, and Like. I want to do a query that gets each name and
their most recent like. I ha
I have two tables and want to attach and return the most recent data from
the second table.
Table 1 has a counter ID and name. Table 2 has a counter ID, Reference (to
Table 1 ID), Date, and Like. I want to do a query that gets each name and
their most recent like. I have a unique key setup on like
Jeff Lanzarotta wrote:
Sam Mason <[EMAIL PROTECTED]> wrote: On Tue, Oct 16, 2007 at 07:46:34AM -0700,
Jeff Lanzarotta wrote:
Hello,
I have a table that looks something like this:
SKU Dept Col1 Col2 Col3
--- -- --- --- --
1112 3
Okay, actually the query is something like:
select dept, (col1 + col2) * col3) from table group by dept
So, the output would look something like:
DeptTotal
-- ---
1 26
2 18
3 9
Sam Mason <[EMAIL PROTECTED]> wrote: On Tue, Oct 16, 2007 at 07:46:34AM -0700,
On 10/16/07, Jeff Lanzarotta <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have a table that looks something like this:
>
> SKU Dept Col1 Col2 Col3
> --- -- --- --- --
> 1112 3
> 2123 4
> 321
On Tue, Oct 16, 2007 at 07:46:34AM -0700, Jeff Lanzarotta wrote:
> Hello,
>
> I have a table that looks something like this:
>
> SKU Dept Col1 Col2 Col3
> --- -- --- --- --
> 1112 3
> 2123 4
> 32
Hello,
I have a table that looks something like this:
SKU Dept Col1 Col2 Col3
--- -- --- --- --
1112 3
2123 4
3210 1
4201 2
524