Getting values from multiple tables using a single query in sql

sample tables

There are two tables Customer_table and Customer_profit. If we need to get the company contact number and company profit using a single query we can use a simple joining technique for example

SELECT U.`Contact`,P.`Profit` FROM `Customer_table` U ,`Customer_profit` P WHERE U.`Company`=P.`Company` AND U.`Company`='Ernst Handel'

using the above query we can get contact and profit of “Ernst Handel” Company. using a different type of alphabet we can add tables to the above query. Each alphabet must use before representing the table columns

About the author

Junaid V J

My self Junaid . This Blog is a platform to gain immense knowledge of web development. Modern web designing and development can be acquired through this. Specialized in HTML, PHP, CSS, JAVASCRIPT , BOOTSTRAP,WORDPRESS, CODEIGNITER.

View all posts

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *