If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Db object.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-20-10, 07:54
caroll caroll is offline
Registered User
 
Join Date: Oct 2010
Posts: 16
Db object.

Can we use join while creating DB object?
Reply With Quote
  #2 (permalink)  
Old 10-20-10, 08:15
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
I dunno, why not try it and find out for yourself
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 10-20-10, 12:32
it-iss.com it-iss.com is offline
Registered User
 
Join Date: Sep 2009
Location: San Sebastian, Spain
Posts: 623
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
Senior Oracle/MySQL DBA
http://www.it-iss.com
Reply With Quote
  #4 (permalink)  
Old 10-20-10, 13:11
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 10-21-10, 00:26
caroll caroll is offline
Registered User
 
Join Date: Oct 2010
Posts: 16
thank you friends.....
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On