Sorry for the lack of detail.
The primary key is ID_ENC_TOY_IMAGE. The error is that it returns no records at all.
But that's o.k. don't spend too much time banging your head on it. I'll stick with 2
queries if I have to.
---mark
--------------------------------------------------------------
Mark Warrick
Phone: (714) 547-5386
Efax.com Fax: (801) 730-7289
Personal Email: [EMAIL PROTECTED]
Personal URL: http://www.warrick.net
Business Email: [EMAIL PROTECTED]
Business URL: http://www.fusioneers.com
ICQ: 346566
--------------------------------------------------------------
> -----Original Message-----
> From: DeVoil, Nick [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 22, 2000 1:46 AM
> To: CF-Talk
> Subject: RE: SQL Select Max + a column
>
>
> > "nope"
>
> Now that's what I call a meaningful error message ;-)
>
> That type of query should work but I'm not sure what your
> primary key is on that table. That's what needs to be in
> lines 3 and 4.
>
> Nick
>
>
> -----Original Message-----
> From: Mark Warrick [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 22, 2000 9:40 AM
> To: CF-Talk
> Subject: RE: SQL Select Max + a column
>
>
> Nice try. But nope.
>
> --------------------------------------------------------------
> Mark Warrick
> Phone: (714) 547-5386
> Efax.com Fax: (801) 730-7289
> Personal Email: [EMAIL PROTECTED]
> Personal URL: http://www.warrick.net
> Business Email: [EMAIL PROTECTED]
> Business URL: http://www.fusioneers.com
> ICQ: 346566
> --------------------------------------------------------------
>
>
> > -----Original Message-----
> > From: DeVoil, Nick [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, September 22, 2000 1:33 AM
> > To: CF-Talk
> > Subject: RE: SQL Select Max + a column
> >
> >
> > Mark
> > How about sth like
> >
> > SELECT ID_ENC_TOY_IMAGE, ENC_TOY_IMAGE_LINK_TEXT
> > FROM ENC_TOY_IMAGE
> > WHERE ID_ENC_TOY =
> > (SELECT max(ID_ENC_TOY_IMAGE)
> > FROM ENC_TOY_IMAGE
> > WHERE ID_ENC_TOY = #ID_ENC_TOY#)
> >
> > Nick
> >
> > -----Original Message-----
> > From: Mark Warrick [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, September 22, 2000 9:28 AM
> > To: CF-Talk
> > Subject: SQL Select Max + a column
> >
> >
> > I'm trying to do this:
> >
> > SELECT ID_ENC_TOY_IMAGE, ENC_TOY_IMAGE_LINK_TEXT
> > FROM ENC_TOY_IMAGE
> > WHERE ID_ENC_TOY = #ID_ENC_TOY#
> >
> > But I want the max ID_ENC_TOY_IMAGE row.
> >
> > I've tried:
> >
> > SELECT max (ID_ENC_TOY_IMAGE) as maxid, ENC_TOY_IMAGE_LINK_TEXT
> > FROM ENC_TOY_IMAGE
> > WHERE ID_ENC_TOY = #ID_ENC_TOY#
> >
> > But I get an aggregate error.
> >
> > If I leave off the extra column it works fine, but of course
> then I'd have
> > to run another query to get the remaining info I need.
> >
> > I could also select all records and then order them in
> descending order by
> > ID_ENC_TOY_IMAGE, but that seems like an awful waste of processor power.
> >
> > Anyone know how to do this the right way?
> >
>
>
> **********************************************************************
> Information in this email is confidential and may be privileged.
> It is intended for the addressee only. If you have received it in error,
> please notify the sender immediately and delete it from your system.
> You should not otherwise copy it, retransmit it or use or disclose its
> contents to anyone.
> Thank you for your co-operation.
> **********************************************************************
> ------------------------------------------------------------------
> ------------
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf
_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the
body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebarRsts&bodyRsts/cf_talk or send a message
to [EMAIL PROTECTED] with 'unsubscribe' in the body.