Also, are you aware of the where clause? e.g.
SELECT id, blah1, blah2 FROM blahTable where id = 3 Assuming id is a unique key, will only return the row you want. Cheers, Phil. ----- Original Message ----- From: "Taco Fleur" <[EMAIL PROTECTED]> To: "CFAussie Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, November 26, 2003 9:43 AM Subject: [cfaussie] RE: Select a single row in SQL > TOP 1 > TOP 10 PERCENT > Use order by to get the bottom > > Use SET ROWCOUNT 400 in SQL which is like MAXROWS in CF > > These will get you going.. > > Taco > > -----Original Message----- > From: Ryan Sabir [mailto:[EMAIL PROTECTED] > Sent: Wednesday, 26 November 2003 8:35 AM > To: CFAussie Mailing List > Subject: [cfaussie] Select a single row in SQL > > > Hi all, > > This seems like a simple question... how do I only return a specific > row from a database, in SQL? > > I have read about the LIMIT command, e.g.: > > SELECT id, blah1, blah2 > FROM blahTable > LIMIT 3,1 > > Which in theory should only return row 3, but this doesn't seem to > work in MS SQL 2000. I think its a MySQL thing. > > I know I can do this in Cold Fusion using the startrow and maxrows > attributes, but this would be inefficient as it would still be getting > the entire table each time. Surely there's a way to do it in SQL? > > thanks, bye! > > ----------------------- > Ryan Sabir > Newgency Pty Ltd > 2a Broughton St > Paddington 2021 > Sydney, Australia > Ph (02) 9331 2133 > Fax (02) 9331 5199 > Mobile: 0411 512 454 > http://www.newgency.com/index.cfm?referer=rysig > > > --- > You are currently subscribed to cfaussie as: [EMAIL PROTECTED] > To unsubscribe send a blank email to [EMAIL PROTECTED] > > MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia > http://www.mxdu.com/ + 24-25 February, 2004 > > --- > You are currently subscribed to cfaussie as: [EMAIL PROTECTED] > To unsubscribe send a blank email to [EMAIL PROTECTED] > > MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia > http://www.mxdu.com/ + 24-25 February, 2004 > --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004
