SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    get back to rowing khu19's Avatar
    Join Date
    Jan 2003
    Location
    New York / Boston
    Posts
    593
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Eliminate multiple queries to MS SQL?

    I have a table 3 column table:

    ID, TITLE, CATEGORYID

    and a second table to hold the categories

    ID CATEGORY

    On my page I want to display all the entries in table1 by category. By making a query to the database for each category allows me to access and display the data as needed. Is there a way to minimize the number of queries to the database?

  2. #2
    SitePoint Guru silver trophy zakruvalcaba's Avatar
    Join Date
    May 2003
    Location
    San Diego
    Posts
    786
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Joining the two tables would effectively reduce your queries to one.
    Zak Ruvalcaba, MCAD, MCSD
    SitePoint Author: Build Your Own ASP.NET Website using C#/VB.NET
    Sams Author: Dreamweaver MX 2004 Unleashed

  3. #3
    get back to rowing khu19's Avatar
    Join Date
    Jan 2003
    Location
    New York / Boston
    Posts
    593
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah thats what i ended up doing, thanks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •