Loading ...
Sorry, an error occurred while loading the content.

Re: [coldfusion-howto] Help with SQL

Expand Messages
  • SB
    Got it to work! Thanks. ... From: John Bartlett To: coldfusion-howto@yahoogroups.com Sent: Monday, October 13, 2008 9:32 PM Subject: Re: [coldfusion-howto]
    Message 1 of 6 , Oct 13, 2008
    View Source
    • 0 Attachment
      Got it to work! Thanks.

      ----- Original Message -----
      From: John Bartlett
      To: coldfusion-howto@yahoogroups.com
      Sent: Monday, October 13, 2008 9:32 PM
      Subject: Re: [coldfusion-howto] Help with SQL


      You'll need to create indexes on your fields.

      ----- Original Message -----
      From: "SB" <srimantab@...>
      To: <coldfusion-howto@yahoogroups.com>
      Sent: Monday, October 13, 2008 1:23 AM
      Subject: Re: [coldfusion-howto] Help with SQL

      Thanks John.
      Just tried using your query.
      I have 20000 rows of data and the page is timing out.

      SB

      ----- Original Message -----
      From: John Bartlett
      To: coldfusion-howto@yahoogroups.com
      Sent: Monday, October 13, 2008 9:14 PM
      Subject: Re: [coldfusion-howto] Help with SQL

      select p.brand, p.model, p.saleprice
      from product p
      where p.saleprice=(select max(saleprice) from product where brand=p.brand
      and model=p.model)

      -John

      ----- Original Message -----
      From: "SB" <srimantab@...>
      To: <coldfusion-howto@yahoogroups.com>
      Sent: Monday, October 13, 2008 12:57 AM
      Subject: [coldfusion-howto] Help with SQL

      Hello,

      I have a product table with multiple rows of similar products but with
      different prices.

      product table fields: brand, model, saleprice

      acer acermonitor1, $100
      acer acermonitor1, $200
      acer acermonitor2, $240
      acer acermonitor2, $300
      acer acermonitor2, $100
      acer acermonitor2, $100
      acer acermonitor4, $230
      acer acermonitor4, $100

      Can some one advise what query should I use so that the in the output I
      always get each of the model with the max price?

      Out put required:

      brand model saleprice

      [Non-text portions of this message have been removed]

      ------------------------------------

      ~~~~~~~~~
      *** Yahoo's No. 1 and the biggest group of ColdFusion Developers

      ColdFusion MX Hosting - 250 MB Space/5 GB monthly Bandwidth for just
      $19.99/year. Free Setup, ASP.NET, HELM Control Panel.
      http://www.hostingatoz.com We also offer ColdFusion Reseller Hosting
      Plans.

      Post message: coldfusion-howto@yahoogroups.com
      Subscribe: coldfusion-howto-subscribe@yahoogroups.com
      Un-Subscribe: coldfusion-howto-unsubscribe@yahoogroups.com

      ...
      Yahoo! Groups Links

      [Non-text portions of this message have been removed]

      ------------------------------------

      ~~~~~~~~~
      *** Yahoo's No. 1 and the biggest group of ColdFusion Developers

      ColdFusion MX Hosting - 250 MB Space/5 GB monthly Bandwidth for just
      $19.99/year. Free Setup, ASP.NET, HELM Control Panel.
      http://www.hostingatoz.com We also offer ColdFusion Reseller Hosting Plans.

      Post message: coldfusion-howto@yahoogroups.com
      Subscribe: coldfusion-howto-subscribe@yahoogroups.com
      Un-Subscribe: coldfusion-howto-unsubscribe@yahoogroups.com

      ...
      Yahoo! Groups Links





      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.