SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard silver trophy KLB's Avatar
    Join Date
    Nov 2003
    Location
    Maine USA
    Posts
    3,781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Techworld review of MySQL 5.0

    Techworld has a really good review of MySQL 5.0 http://www.techworld.com/application...9&reviewid=346

    I was reading up the other day on some of the new features in MySQL 5.0 and as I'm also a MSSQL developer, with some of the features I have to say "its about time." One feature that MySQL 5.0 finally has that I have been dying for is the abilty to create and save views.

    Now if MySQL could handle the inclusion of views in FROM section of a SELECT statement I'd be a really happy camper (well just as soon as I could convince my web host to upgrade to that version of MySQL. The first thing I would do would be to rewrite some of my more messy SQL statements so that they are more efficient.

    I've always liked MySQL and I'm glad to see it finally getting some of those enterprise level features I'm used to in MSSQL.

    The day I could truly use MySQL instead of MSSQL for custom database solutions I provide to some of my smaller clients will be an exciting day MSFT should fear that day.
    Ken Barbalace: EnvironmentalChemistry.com (Blog, Careers)
    InternetSAR.org
    Volunteers Assist Search and Rescue via Internet
    My Firefox Theme: Classic Compact
    Based onFirefox's default theme but uses much less window space

  2. #2
    _ silver trophy ses5909's Avatar
    Join Date
    Jul 2003
    Location
    NoVa
    Posts
    5,466
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I agree.. its about time. For my PHP sites I use PostgreSQL because myqsl just wasn't able to do what I needed. Glad to see they are adding some of my favorite features.
    Sara

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,338
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by KLB
    Now if MySQL could handle the inclusion of views in FROM section of a SELECT statement ...
    you mean, it doesn't?

    so, um, how are views used, then?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  4. #4
    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)
    ya, what is KLB smokin'?
    Code:
    mysql> create table foo (foo int);
    Query OK, 0 rows affected (2.02 sec)
    
    mysql> insert into foo values (1), (2), (3);
    Query OK, 3 rows affected (0.13 sec)
    Records: 3  Duplicates: 0  Warnings: 0
    
    mysql> create view bar as select 'bar' as bar, foo from foo;
    Query OK, 0 rows affected (0.59 sec)
    
    mysql> select foo from bar;
    +------+
    | foo  |
    +------+
    |    1 |
    |    2 |
    |    3 |
    +------+
    3 rows in set (0.02 sec)
    
    mysql> select version();
    +---------------+
    | version()     |
    +---------------+
    | 5.0.17-nt-max |
    +---------------+
    1 row in set (0.02 sec)

  5. #5
    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)
    ah, i see what KLB is refering to:
    (e.g. you can't use subqueries in the FROM clause yet).
    Code:
    mysql> drop view bar;
    Query OK, 0 rows affected (0.13 sec)
    
    mysql> select * from (select * from foo) as dt;
    +------+
    | foo  |
    +------+
    |    1 |
    |    2 |
    |    3 |
    +------+
    3 rows in set (0.00 sec)
    
    mysql> create view bar as select * from (select * from foo) as dt;
    ERROR 1349 (HY000): View's SELECT contains a subquery in the FROM clause
    but i think this was relaxed in 5.1

  6. #6
    SitePoint Wizard silver trophy KLB's Avatar
    Join Date
    Nov 2003
    Location
    Maine USA
    Posts
    3,781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    you mean, it doesn't?

    so, um, how are views used, then?
    I haven't figured that out yet. The examples I have seen append or update into a view but even MySQL documentation says they can't be called via FROM. There is a footnote that this ability should be added very shortly (e.g. v5.0.3). It sounds like to me that they have decided to make v5 a series of rolling feature enhancements for things that didn't quite make the original v5 cut off.
    Ken Barbalace: EnvironmentalChemistry.com (Blog, Careers)
    InternetSAR.org
    Volunteers Assist Search and Rescue via Internet
    My Firefox Theme: Classic Compact
    Based onFirefox's default theme but uses much less window space


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
  •