SQL Unions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • justFred
    Confirmed User
    • Mar 2007
    • 922

    #1

    SQL Unions

    are multiple SELECT statements joined by a UNION considered one or multiple queries?
    Vote Bill Cosby 2012
  • 2012
    So Fucking What
    • Jul 2006
    • 17189

    #2
    you use a UNION so you don't have to use multiple queries so I would say it's one query
    best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself

    Comment

    • justFred
      Confirmed User
      • Mar 2007
      • 922

      #3
      that's what I thought as well but I just wanted to confirm, because I'm limited in the number of queries on my host.

      THANKS fartfly
      Vote Bill Cosby 2012

      Comment

      • Spicoli
        Confirmed User
        • Apr 2007
        • 306

        #4
        careful with union queries, they're hard on performance !!!
        usually not recommended.

        why can't you write SQL on the fly in your pages?????????
        you can write as many as you want with that, and it's not a big hit on performance, relatively speaking.

        you don't 'need' to have stored queries, they're just better if your running MS SQL server because it generates an execution map the first time you run it, then remembers for every other time. Just speeds it up. If you doing simple queries, you don't need stored queries.
        Last edited by Spicoli; 11-25-2007, 05:58 AM.
        hit me! ICQ: 498192465
        get hookin up! jismfactory.com! tapthatbabe.com! some tits n ass! more tits n azz!
        get the gator - Unlimited Domain Hosting Only $9.95 a Month
        Never take life too seriously. Nobody gets out alive anyway

        Comment

        • justFred
          Confirmed User
          • Mar 2007
          • 922

          #5
          Originally posted by Spicoli
          careful with union queries, they're hard on performance !!!
          usually not recommended.

          why can't you write SQL on the fly in your pages?????????
          you can write as many as you want with that, and it's not a big hit on performance, relatively speaking.

          you don't 'need' to have stored queries, they're just better if your running MS SQL server because it generates an execution map the first time you run it, then remembers for every other time. Just speeds it up. If you doing simple queries, you don't need stored queries.
          hehe, because I'm just starting out in SQL and want to not leave anything to chance with more advanced methods, until I grab the basics and build upon them. The info I'm working off uses stored queries, and I just read a chapter about unions, and was wondering whether this would be hard on servers with limited number of queries

          the project I'm working on is a lightweight TGP script. I know I'm re-inventing the wheel, but I like to know exactly how something works if I'm going to be building on top of it. This makes it so I can further develop and improve upon it, and maybe eventually share it with others.


          you asked
          Vote Bill Cosby 2012

          Comment

          Working...