SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2004
    Location
    berlin
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql: multliple results with one query

    hello,

    i try to realize a broker class for php which dynamically generates a sql-query out of many sql-request. background is to save performance.

    is there any possibility to 'group' sql-statements and -more important - get the results anyway separated out of the resultset?

    best,
    andi

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,215
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    you can do this with a UNION, except that each SELECT query in the union has to have the same number of columns and the column datatypes have to be compatible (numbers with numbers, strings with strings, dates with dates)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Member
    Join Date
    Oct 2004
    Location
    berlin
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, but afaik i can't get the single information back from one of the 'sub-selects'. but this is what i'd like to have. i wanna do something for the performance.

    i guess, its impossible...

    best, andi


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
  •