Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

RE: [PHP-DB] I have a query
if the tables have the same structure, use the union operator to query each
table separately and return it all in one result set

select * from asset1 where asset_loc='heaven'
union
select * from asset2 where asset_loc='heaven'
union
select * from asset3 where asset_loc='heaven'
union
select * from asset4 where asset_loc='heaven'
union
select * from asset5 where asset_loc='heaven'

bastien




>From: "Mulley, Nikhil" <mnikhil@corp.untd.com>
>To: <php-db@lists.php.net>
>Subject: [PHP-DB] I have a query
>Date: Wed, 29 Sep 2004 23:19:31 +0530
>
>I have a query regarding mysql and PHP ...
>here it is ....
>I know there is a field data exisiting in one of the tables in the present
>database;
>
>I want to know whether there is any sql or PHP function with which I can
>find out in which table the field data is present for example .....
>
>
>I have database called asset
>in which 5 table are present namely asset1,asset2,asset3,asset4,asset5...
>
>all the tables have the same schema structure and common field names ,equal
>no of columns(but not the equal number of rows)
>
>I want to know ,in which table among the above is having a particular field
>data for example ...the column name is asset_loc ( common for all the
>tables,but no constraints ,no relation with other tables)
>
>I want to know if the asset_loc from any table has the data 'heaven'
>
>it should be something like this
>select * from asset1,asset2,asset3,asset4,asset5 where asset_loc='heaven';
>
>
>
>Thanks, waiting for a quick response ....from a great list.
>
>SELECT * FROM Linux_kids where Dis_Hard_Fans='Nikhil' ;-)
>
>

 ________________________________________
_________________________
Take advantage of powerful junk e-mail filters built on patented Microsoft®
SmartScreen Technology.
http://join.msn.com/?pgmarket=en-ca..._MSNIS_Taglines
Start enjoying all the benefits of MSN® Premium right now and get the
first two months FREE*.

Report this thread to moderator Post Follow-up to this message
Old Post
Bastien Koert
09-30-04 01:03 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP DB archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:40 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.