3 Replies Latest reply on Nov 1, 2006 6:55 AM by Newsgroup_User

    Display SQL listings only once with a count next to the number

    rustbckt
      I am building a vacation rental website (like there needs to be another one LOL) I am building my SQL database right now but i believe it will be easier if we display it better. What I want to do is display the rental listings only once in a list. Example:

      Listing 12345 with pool in Orlando Florida
      Listing 34567 on golf community in Orlando Florida
      Listing 98765 Waterfront in Ft Lauderdal Florida

      I want a page to show before the listings so you would see

      Ft. Lauderdale (1)
      Orlando (2)

      When you click Orlando (2) then you would just get just Orlando listing to make navigating more simple.

      You can see a sample on http://www.vacationrentals.com/vacation-rentals/Florida.html (hope the sample link is ok to use)

      Thanks for the Help
        • 1. Re: Display SQL listings only once with a count next to the number
          Level 7
          That's a simple GROUP BY with a COUNT. Take a few minutes and familiarize
          yourself with the essential capabilities of SQL - it may even give you some
          ideas. :)
          www.sqlcourse.com
          www.sqlcourse2.com


          "rustykat" <webforumsuser@macromedia.com> wrote in message
          news:ei63ds$dv9$1@forums.macromedia.com...
          >I am building a vacation rental website (like there needs to be another one
          > LOL) I am building my SQL database right now but i believe it will be
          > easier
          > if we display it better. What I want to do is display the rental listings
          > only
          > once in a list. Example:
          >
          > Listing 12345 with pool in Orlando Florida
          > Listing 34567 on golf community in Orlando Florida
          > Listing 98765 Waterfront in Ft Lauderdal Florida
          >
          > I want a page to show before the listings so you would see
          >
          > Ft. Lauderdale (1)
          > Orlando (2)
          >
          > When you click Orlando (2) then you would just get just Orlando listing to
          > make navigating more simple.
          >
          > You can see a sample on
          > http://www.vacationrentals.com/vacation-rentals/Florida.html (hope the
          > sample
          > link is ok to use)
          >
          > Thanks for the Help
          >
          >


          • 2. Re: Display SQL listings only once with a count next to the number
            rustbckt Level 1
            What a great website! I have the count function and see how it works but I can't get it to display on the site because there isn't really a colum for it. how would I write that so it will display on the site next to the city name? Again what a great website!

            Thanks
            • 3. Re: Display SQL listings only once with a count next to the number
              Level 7
              "rustykat" <webforumsuser@macromedia.com> wrote in message
              news:ei8oen$ma3$1@forums.macromedia.com...
              > What a great website! I have the count function and see how it works but
              > I
              > can't get it to display on the site because there isn't really a colum for
              > it.
              > how would I write that so it will display on the site next to the city
              > name?
              > Again what a great website!
              >
              > Thanks
              >

              I'm glad you found it useful! :)

              The one thing I should have mentioned (it's not part of the SQL course
              because it's really a quirk of how DW works with result sets) is that you
              have to give your column expressions names to use them in a DW recordset.

              So you'd have
              SELECT City, COUNT(*) AS ListingCount

              or something very similar. Then you can refer to ListingCount in your web
              page to use it like a normal column.