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 > how to select one column from 3 tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-11-11, 05:16
wetube wetube is offline
Registered User
 
Join Date: Oct 2011
Posts: 1
Post how to select one column from 3 tables

hello,
i want to select one same column from 3 tables and get a rows from this one column

let's bring the code

mysql_query("SELECT * from tv,movies WHERE hash='123'");

so now i want the column called hash from the tv and movies to bring result from the hash number
Reply With Quote
  #2 (permalink)  
Old 10-11-11, 05:47
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
if you have WHERE hash='123' then why do you want to return the hash column? you already know what value it's gonna have
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 10-11-11, 06:02
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,407
Additionally: you are missing a join condition between tv and movies.
Reply With Quote
Reply

Tags
column, multiple, select, tables

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