Share on Google+Share on Google+

Madhan Raja
Sql Join Query
0 Answer(s)      4 years and 3 months ago
Posted in : SQL
aTable Name : TblState

Stid        StateName     CountryId
---------------------------------------------
01      TN        01
02      KR        01
03      KL        01
04      WB        01
05      New York      02
06      Oregon        02            



Table Name : TblDist

Did Stateid         DistName     CountryId
-----------------------------------------------------   
01  01      Chennai       01
02  01      Covai         01    
03  01      Madurai       01
04  03      Palakkad      01
06  05      AAA       02
08  06      XXX       02            


I need output for like this conditoin(tblstate.CountryId=tblDist.countryId)

Output

Stateid StateName
------------------------
01  TN
01  TN
01  TN  
03  KL

Ads

View Answers









Related Tutorials/Questions & Answers:
upgrading sql query join
upgrading sql query join  upgrading sql query join
Sql Join Query
Sql Join Query  aTable Name : TblState Stid StateName CountryId --------------------------------------------- 01 TN 01 02 KR 01 03 KL 01 04 WB 01 05 New
Advertisements
Join the two tables in sql
Join the two tables in sql  How to join the two tables in SQL ..and return the value from common column in SQL Database
PHP SQL Inner Join
PHP SQL Inner Join  This Example illustrates how to use the inner join clause in the sql query. The inner join return rows when there is at least one match in both tables. This is the good example to understand inner join clause
SQL Right JOIN
=table_name2.column_name Use Right JOIN in SQL Query The Example shows you the RIGHT JOIN in SQL Query. In this  Example, we use... SQL Right JOIN      
SQL LEFT JOIN
SQL LEFT JOIN      ... with Example The Tutorial illustrate an example from SQL LEFT JOIN... 4 104 5 105 SQL INNER JOIN
PHP SQL Left Join
PHP SQL Left Join  This Example illustrates how to use left join clause in the sql query. The left join return all rows from the left table, even if there are no matches in the right table. In this example left join is used
PHP SQL Right Join
PHP SQL Right Join  This Example illustrates how to use right join clause in the sql query. The right join return all rows from the right table, even if there are no matches in the left table. In this example right join is used
SQL Join
SQL Join      ... 'roseindia'.    Mysql Join Query The Tutorial illustrate an example from Mysql Join Query. To grasp this we create a table
Sql Query
Sql Query  Is this query work in Db2 or not ? Select * from FORUM LIMIT 2
Sql Query
Sql Query  Is this query work in Db2 or not ? Select * from FORUM LIMIT 2
sql query
sql query  two tables are emp,loc write a query to display all the emp information whose locname not equal to bangalore
Sql Query
Sql Query  Hi M Navjeet Ghai I want to know How to Show A name(Like Navjeet Ghai And Manpreet Singh Sodhi) of employees from a employee table as N.Ghai & M.S.Sodhi by using sql query
sql query
sql query  hi friend, Im doing a project,in that a main id... numbers of sids.i want to delete the sid based on the mid.for that i need sql query plz help to me
sql query
sql query  hi friend, Im doing a project,in that a main id... numbers of sids.i want to delete the sid based on the mid.for that i need sql query plz help to me
sql query
sql query  hi friend, Im doing a project,in that a main id... numbers of sids.i want to delete the sid based on the mid.for that i need sql query plz help to me
SQL Query
SQL Query  Selecting the third highest salary of Employee without using any subquery?   Here is a query: SELECT salary FROM employee ORDER BY salary DESC LIMIT 2,1
SQL QUERY
SQL QUERY  am a having a table 'PROGRAMMER' with columns... C pascal Bhanu Sql... Pascal Sql Mahesh DBASE Cobol
SQL query
SQL query  I need to combine two tables in order to get the values. As an example we have three tables having namely usertable,job table... inner join in order to get the user_id. Please help me
Sql aggregate function with left join wrong output
Sql aggregate function with left join wrong output    I have three...(display 600 instead of 200) My sql query is : select s.partno,s.partname,sum(i.InvoiceQuantity),sum(p.IssueQuantity) from Stock s left join InwardEntry i
Sql aggregate function with left join wrong output
Sql aggregate function with left join wrong output    I have three...(display 600 instead of 200) My sql query is : select s.partno,s.partname,sum(i.InvoiceQuantity),sum(p.IssueQuantity) from Stock s left join InwardEntry i
Sql aggregate function with left join wrong output
Sql aggregate function with left join wrong output    I have three...(display 600 instead of 200) My sql query is : select s.partno,s.partname,sum(i.InvoiceQuantity),sum(p.IssueQuantity) from Stock s left join InwardEntry i
sql query
sql query  SQL QUERY BROWSER declare @cout00 int declare @cout01 int declare @cout10 int declare @cout11 int declare @c1 float declare @gss float...); this is the query i have written for the table "dpscomp" - station date month
SQL Query - SQL
SQL Query  Hi I would like to know how to create a SQL query which would copy values from a field which contains multiple values to an existing... | +-----+-----------+-------------+ Query: INSERT INTO table2 (fruit1, fruit2, fruit3
query - SQL
tell me how to write the query in database but not jsp code. thank u
Mysql Join Query
Mysql Join Query       Mysql Join Query is used to return the matchable records from ... The Tutorial illustrate an example from Mysql Join Query. To grasp this we create a table
sql query - SQL
sql query  hi sir,i have a month and year numbers,when i am enter a month and year in sql query then i want results for 1st day of month to last day of month in that year for that month plz provide a solution
optimize sql query
optimize sql query  How to optimize sql query in mysql? Thanks
sql query - JDBC
sql query  I need a SQL query to add data into database
PHP SQL Left Join
PHP SQL Left Join       This Example illustrates how to use left join clause in the sql queryJOIN is used to query data from two or more tables. The left join
PHP SQL Right Join
PHP SQL Right Join       This Example illustrates how to use right join clause in the sql queryJOIN is used to query data from two or more tables. The right
Tutorials   
Java Spring Hibernate Struts Training How to Fetch Data using dropdown option How to get day from date in SQL? Example of sorting results in MySQL Distinct and Limit example in MySQL How to download install and use MySQL workbench? Example of Average, Sum, Min and Max functions in MySQL How to delete data from MySQL? Update SQL Query Example Order by example in MySQL AND and OR Operators in MySQL Query Where clause with query in MySQL How to use select Statement in MySQL? How to insert data into MySQL Table? Create Database and tables in MySQL example of before insert trigger in mysql Failed to Call Procedure MY Sql Query Error - Not able to Understand the issue which query will be run for previous(button) question How to access data yearly from DB in C# ? Fastest way to upload huge raw data in database - c#, Java or stored procedure DB Insert Nb hours between 2 time stamps meets specific criteria mysql select into table from another table example MySQLselect into new table Example code How to create a .mdf file from script (.sql) Please help me out fixing broken relational links in MySQL database after an upgrade How do I upgrade mysql? mysql 4.x to 5.x upgrade problem Upgrading a PHP/MYSQL application? upgrading sql query join phpmyadmin in whm whm php version update php cpanel cpanel mysql downgrade cpanel mysql version upgrade mysql whm upgrade mysql 4 5 cpanel upgrade mysql cpanel server Did my upgrade from mySQL 5.1 to 5.5 work Upgrade to MySQL 5.5 ? - cPanel Mem use upgrade from MySQL 5.1 to 5.5 - cPanel Upgrading MySQL from 5.0 to 5.1 or 5.5 - cPanel Mysql Upgrade on WHM (Mysql 5.1 to 5.5)cPanel Mysql Upgrade on WHM (Mysql 5.1 to 5.5) - cPanel Updating from MySQL 5.0 to 5.5 cPanel MySQL 5.1 upgrade to 5.5 error Charset problem upon publishing PHP + MySQL website MySQL issue: Table 'data_dictionary.CHARACTER_SETS' doesn't exist SQL Error Version 5.5.15

Ads

 
Advertisement null

Ads