473,320 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

equalise data from one table column to another table column

hello friends!

Can anyone help me to matching one column databases from another colunm databases.

For example:

The below table name is domains

Expand|Select|Wrap|Line Numbers
  1. ----------------------------------------------------------
  2. id | name   |  domains
  3. ---|--------|---------------------------------------------
  4. 1  | tamil  |  example1.com
  5.      |                    |
  6. 2  | bala   |  example2.com
  7.      |                    |
  8. 3  | ramu   |  example3.com
  9.      |                    |
  10. 4  | ravi   |  example4.com
  11.      |                    |
  12.      |                    |
  13.      |                    |
  14. ----------------------------------------------------------

The below table name is : notifications

Expand|Select|Wrap|Line Numbers
  1. ----------------------------------------------------------
  2. id | domain        |  notifications
  3. ---|---------------|--------------------------------------
  4. 1  | example1.com  |  notification1
  5.      |                           |
  6. 2  | example2.com  |  notification2
  7.      |                           |
  8. 3  | example3.com  |  notification3
  9.      |                           |
  10. 4  | example4.com  |  notification4
  11.      |                           |
  12.      |                           |
  13.      |                           |
  14. ----------------------------------------------------------

My question is,

Tamil, bala, ramu, ravi are the users in my website
every one having each domains in their account which is mentioned in the domains table

tamil is having domain name example1.com,
bala is having domain name example2.com,
ramu is having domain name example3.com,
ravi is having domain name example4.com


I want to get the result of notifications column from the notifications table if any domains are matching from the domains column in the domains table with the domain column of the notification table.

Finally, I want get the notification results

(I am creating this for who are the users logged with their account notifications should get matching domains from first table to second table of the user)

I think my question is understood to everyone, please help me friends...

Thank You
Jun 15 '14 #1

✓ answered by Luuk

This wil show the notifications for 'tamil'
Expand|Select|Wrap|Line Numbers
  1. SELECT d.name, d.domains, n. notifications
  2. FROM domains d
  3. LEFT JOIN notifications n
  4.   ON n.domain=d.domains
  5. WHERE d.name='tamil'
  6.  

2 1273
Luuk
1,047 Expert 1GB
This wil show the notifications for 'tamil'
Expand|Select|Wrap|Line Numbers
  1. SELECT d.name, d.domains, n. notifications
  2. FROM domains d
  3. LEFT JOIN notifications n
  4.   ON n.domain=d.domains
  5. WHERE d.name='tamil'
  6.  
Jun 15 '14 #2
Thank you brother for your quick reply. It works very well.

Thank u
Jun 15 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Deja User | last post by:
This is probably very simple but I can't figure out a way to update one table from another table. Here is an example: ------ TABLEA ------ first_name last_name
1
by: Mike9900 | last post by:
What is the best way to copy DataRow from one table to another table, without copying its structure, which means copying only its data. -- Mike
1
by: thengfen | last post by:
Hi! Im having a problem in transfering a set of records from a table to another table. The scenario is when i select combo box (Course taken such as diploma in IT), then the process will...
1
by: Sakakini | last post by:
How can I append last entry from one table to another table???
4
by: xoozlez | last post by:
Hi there, How do I insert new records from a dbo table to another table? This is what I have: 1 dbo_company 1 Member (table) I made a query in dbo_company with the criteria I only want to...
3
by: anil2083 | last post by:
How to migrate the comma separated values from one table to another table? suppose we have table i.e XYZ and we have comma separated values in few columns i.e( column_name and values are...
3
by: shubham rastogi | last post by:
hello guys I want to copy or insert records into the previously created table from another table.. For example I have two tables A and B .... I want to copy or insert records from table B into...
2
by: amitsukte | last post by:
Hi Everyone how should i update multiple columns of a table from another table... Suppose I have table A and B and having four columns each table A(col1,col2,col3,col4) B(col1,col2,col3,col4) ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.