Jump to content

mysql data search help


prakash

Recommended Posts

Hi,

 

I have lots of tables on my database and I need to search all the tables and fields for a specific keywords and list out the data with table fields.

 

Suppose I have 2 tables and following fields as following.

 

table1

===================

field1      field2      field3

===================

aaa        bbb        ccc

bbb        ccc        aaa

ccc        aaa        bbb

 

 

table2

===================

field_a      field_b      field_c

===================

aaa          bbb          ccc

aaa          bbb          ccc

aaa          bbb          ccc

 

so I need to make a query so that I can list out following if searched for keyword 'aaa' it will list out data like:

 

from table1

==============

field1: aaa

field2: bbb

field3: ccc

 

field1: bbb

field2: ccc

field3: aaa

 

field1: ccc

field2: aaa

field3: bbb

 

from table2

==============

field_a: aaa

field_b: bbb

field_c: ccc

 

field_a: aaa

field_b: bbb

field_c: ccc

 

field_a: aaa

field_b: bbb

field_c: ccc

 

so can I use a combined query for all the table or have to do it differently. what will be the query??

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.