Results 1 to 5 of 5

Thread: Db object.

  1. #1
    Join Date
    Oct 2010
    Posts
    19

    Unanswered: Db object.

    Can we use join while creating DB object?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I dunno, why not try it and find out for yourself
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    Hi,

    your question is very vague. It is possible to create a table based on a select statement so enhancing the SELECT statement to include a join might work.

    Code:
    mysql> create table t_select as
        -> select * from test;
    Query OK, 3 rows affected (0.08 sec)
    Records: 3  Duplicates: 0  Warnings: 0
    
    mysql> desc t_select;
    +--------+---------------+------+-----+---------+-------+
    | Field  | Type          | Null | Key | Default | Extra |
    +--------+---------------+------+-----+---------+-------+
    | name   | varchar(20)   | YES  |     | NULL    |       | 
    | salary | decimal(12,4) | YES  |     | NULL    |       | 
    +--------+---------------+------+-----+---------+-------+
    2 rows in set (0.01 sec)
    
    mysql> desc test;
    +--------+---------------+------+-----+---------+-------+
    | Field  | Type          | Null | Key | Default | Extra |
    +--------+---------------+------+-----+---------+-------+
    | name   | varchar(20)   | YES  |     | NULL    |       | 
    | salary | decimal(12,4) | YES  |     | NULL    |       | 
    +--------+---------------+------+-----+---------+-------+
    2 rows in set (0.01 sec)
    The table t_select did not exist before the create table statement.
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by caroll View Post
    Can we use join while creating DB object?
    the only other database object (besides a table) that you can create while using a join is a view
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Oct 2010
    Posts
    19
    thank you friends.....

Posting Permissions

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