SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast -tcwd-'s Avatar
    Join Date
    Mar 2005
    Location
    Toronto, ON, Canada
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    capitalized queries

    just out of curiosity.. is there any difference (in terms of execution speed, etc.) in using SELECT * FROM table WHERE ..... as opposed to select * from table where ......
    - Edward Sun ..blog.. printdoublesided
    Potential client demands a portfolio, but you don't have one? ...
    Easily create your own portfolio!

  2. #2
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    nope

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    but there could be a speed difference between
    Code:
    select * from tablename
    and
    Code:
    select foo, bar, ... from tablename
    the dreaded, evil "select star" could be slower

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  4. #4
    SitePoint Addict
    Join Date
    Feb 2005
    Location
    Brisbane, Australia
    Posts
    306
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think the thing about capitalisation of SQL-specific terms is more to help clarify what are SQL terms and what are variables such as table names, field names, et cetera.

    When I was learning how to use SQL in school and university, they liked to use the capitalised SQL-specific terms in queries to distinguish between what was SQL and what was our tables and fields - but in the development world, I've seen many coders (myself included) simply type queries entirely in lower case.

  5. #5
    Web Developer stickycarrots's Avatar
    Join Date
    Jul 2005
    Location
    Illinois State University
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've always used SELECT * FROM table WHERE blah='blah'
    I think it's just a habit...

  6. #6
    SitePoint Enthusiast -tcwd-'s Avatar
    Join Date
    Mar 2005
    Location
    Toronto, ON, Canada
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the responses.

    r937 brought up a pretty interesting point. although it is slightly different from my original question, its been a habit for me now to use the select star (like stickycarrots) -_-. thanks for pointing it out.. i'll try to minimize the use of that next time
    - Edward Sun ..blog.. printdoublesided
    Potential client demands a portfolio, but you don't have one? ...
    Easily create your own portfolio!


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
  •