List:General Discussion« Previous MessageNext Message »
From:ViSolve DB Team Date:February 5 2007 3:34am
Subject:Re: select on multiple fields in several tables?
View as plain text  
Hi,

i.e.  you want to retrieve all the records of "john smith" from 3 or 4 
tables.  is it?

if so, use table alias.  domainnames cannot be used directly.--try with
mysql> select * from personal p, payroll r,department d where 
p.ename="johnsmith" or r.ename="johnsmith" or d.ename="johnsmith";

Thanks
ViSolve DB Team.
----- Original Message ----- 
From: "boll" <boll@stripped>
To: "MySQL General Mailing List" <mysql@stripped>
Sent: Sunday, February 04, 2007 10:06 PM
Subject: select on multiple fields in several tables?


> Hello-
>
> I'm working with an unfamiliar application, trying to figure out where my 
> data is going.
>
> Is it possible to form a query to select from all the columns in several 
> tables at once? Something equivalent to:
>    SELECT FROM * WHERE * = 'john smith'; If that's not possible I'd still 
> like to be able to search each table at once without specifying the column 
> names:
>    SELECT FROM <table name>  WHERE * = 'john smith';
> If that can't be done, can a sub query find the column names to be 
> selected on?
>
> Basically, I'm trying to avoid doing separate selects on each column in 
> each table.
>
> This is using MySQL 5.0.27 .
> Thanks for any suggestion or alternative methods!
>
> -John
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: 
> http://lists.mysql.com/mysql?unsub=1
> 

Thread
select on multiple fields in several tables?boll4 Feb
  • Re: select on multiple fields in several tables?Ryan Stille4 Feb
    • Re: select on multiple fields in several tables?boll4 Feb
  • Re: select on multiple fields in several tables?ViSolve DB Team5 Feb
  • Re: select on multiple fields in several tables?Brent Baisley5 Feb