<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Get Common Records From Two Tables Without Using Join</title>
	<atom:link href="http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 10 Feb 2012 02:12:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Aravind</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-242900</link>
		<dc:creator><![CDATA[Aravind]]></dc:creator>
		<pubDate>Tue, 24 Jan 2012 06:48:50 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-242900</guid>
		<description><![CDATA[table1
id name
2   2
-----------
table2
id
2
2
-----------
table3
id
2
2]]></description>
		<content:encoded><![CDATA[<p>table1<br />
id name<br />
2   2<br />
&#8212;&#8212;&#8212;&#8211;<br />
table2<br />
id<br />
2<br />
2<br />
&#8212;&#8212;&#8212;&#8211;<br />
table3<br />
id<br />
2<br />
2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aravind</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-242899</link>
		<dc:creator><![CDATA[Aravind]]></dc:creator>
		<pubDate>Tue, 24 Jan 2012 06:46:52 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-242899</guid>
		<description><![CDATA[Hi Sir i am new to your blog and sql also.i want to merge three tables.is it possible to merge three tables?.
table1
-----------
id name
1  xyz
2  xyz

tale2
--------
id 
1
2

table3
--------
id
1
2

i want to merge id=2 in id=1 and it update all child table.like,
tb1                 tb2              tb3
id  name         id                 id
2   xyz             2                  2
                       2                  2]]></description>
		<content:encoded><![CDATA[<p>Hi Sir i am new to your blog and sql also.i want to merge three tables.is it possible to merge three tables?.<br />
table1<br />
&#8212;&#8212;&#8212;&#8211;<br />
id name<br />
1  xyz<br />
2  xyz</p>
<p>tale2<br />
&#8212;&#8212;&#8211;<br />
id<br />
1<br />
2</p>
<p>table3<br />
&#8212;&#8212;&#8211;<br />
id<br />
1<br />
2</p>
<p>i want to merge id=2 in id=1 and it update all child table.like,<br />
tb1                 tb2              tb3<br />
id  name         id                 id<br />
2   xyz             2                  2<br />
                       2                  2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kunal</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-238255</link>
		<dc:creator><![CDATA[kunal]]></dc:creator>
		<pubDate>Sun, 15 Jan 2012 19:28:56 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-238255</guid>
		<description><![CDATA[Hi sir i have a question related to sql query. i m developing a project on vb.net and in this i have to insert, update and delete and retrieve data in two tables in this both table have a equal column name that is File_Name. then how i perform this plsss. reply me.

waiting for ur response

Plzz.]]></description>
		<content:encoded><![CDATA[<p>Hi sir i have a question related to sql query. i m developing a project on vb.net and in this i have to insert, update and delete and retrieve data in two tables in this both table have a equal column name that is File_Name. then how i perform this plsss. reply me.</p>
<p>waiting for ur response</p>
<p>Plzz.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kunal</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-237961</link>
		<dc:creator><![CDATA[kunal]]></dc:creator>
		<pubDate>Sun, 15 Jan 2012 09:15:40 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-237961</guid>
		<description><![CDATA[Hi sir i have a question related to sql query. i m developing a project on vb.net and in this i have to insert, update and delete and retrieve  data in two tables in this both table have a equal column name that is File_Name. then how i perform this plsss. reply  me. 

waiting for ur response

Plzz.]]></description>
		<content:encoded><![CDATA[<p>Hi sir i have a question related to sql query. i m developing a project on vb.net and in this i have to insert, update and delete and retrieve  data in two tables in this both table have a equal column name that is File_Name. then how i perform this plsss. reply  me. </p>
<p>waiting for ur response</p>
<p>Plzz.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: polesh</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-203860</link>
		<dc:creator><![CDATA[polesh]]></dc:creator>
		<pubDate>Thu, 24 Nov 2011 20:11:21 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-203860</guid>
		<description><![CDATA[Quest:- I have four  tables with a unique identity column and some more columns.i want to get all the columns into one row based on the id column.
1) Data can be available in all the tables 
2)if not available in one of the tables the corresponding columns should show null or zero value.
for ex:-tab1 , tab2 , tab3 , tab4  consists of three columns including unique id column..
but data should come in one row...
Result should be like this:-
ID, tab1.col1,tab1.col2,tab2.col1,tab2.col2,tab3.col1,tab3.col2,tab4.col1,tab4.col2


please help me this is a bit urgent.]]></description>
		<content:encoded><![CDATA[<p>Quest:- I have four  tables with a unique identity column and some more columns.i want to get all the columns into one row based on the id column.<br />
1) Data can be available in all the tables<br />
2)if not available in one of the tables the corresponding columns should show null or zero value.<br />
for ex:-tab1 , tab2 , tab3 , tab4  consists of three columns including unique id column..<br />
but data should come in one row&#8230;<br />
Result should be like this:-<br />
ID, tab1.col1,tab1.col2,tab2.col1,tab2.col2,tab3.col1,tab3.col2,tab4.col1,tab4.col2</p>
<p>please help me this is a bit urgent.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-183793</link>
		<dc:creator><![CDATA[Tom]]></dc:creator>
		<pubDate>Wed, 26 Oct 2011 18:54:44 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-183793</guid>
		<description><![CDATA[On the same note, I have three (3) tables A, B and C, each with same two columns Column1 and Column2, however I suspect that data inside the three tables may differ and I need to find the common data to the three tables, what would be the easier way to accomplish that?

I was thinking: join A and B and put the result on a temp table X
then join A and C and put the result on a table Z
finally join X and Z and get my result. 
I believe there is a flow on that logic but I cannot point it out.
Any response much appreciated.]]></description>
		<content:encoded><![CDATA[<p>On the same note, I have three (3) tables A, B and C, each with same two columns Column1 and Column2, however I suspect that data inside the three tables may differ and I need to find the common data to the three tables, what would be the easier way to accomplish that?</p>
<p>I was thinking: join A and B and put the result on a temp table X<br />
then join A and C and put the result on a table Z<br />
finally join X and Z and get my result.<br />
I believe there is a flow on that logic but I cannot point it out.<br />
Any response much appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-182952</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Mon, 24 Oct 2011 16:02:39 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-182952</guid>
		<description><![CDATA[Follow this post. This is exactly what you want
http://beyondrelational.com/blogs/madhivanan/archive/2009/12/14/search-a-value-in-character-column-of-all-tables.aspx]]></description>
		<content:encoded><![CDATA[<p>Follow this post. This is exactly what you want<br />
<a href="http://beyondrelational.com/blogs/madhivanan/archive/2009/12/14/search-a-value-in-character-column-of-all-tables.aspx" rel="nofollow">http://beyondrelational.com/blogs/madhivanan/archive/2009/12/14/search-a-value-in-character-column-of-all-tables.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-182914</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Mon, 24 Oct 2011 14:03:43 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-182914</guid>
		<description><![CDATA[You can restore it in server. or you can attach the database files too]]></description>
		<content:encoded><![CDATA[<p>You can restore it in server. or you can attach the database files too</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: guna</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-182832</link>
		<dc:creator><![CDATA[guna]]></dc:creator>
		<pubDate>Mon, 24 Oct 2011 10:09:04 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-182832</guid>
		<description><![CDATA[sir, how to local db upload in my server Db]]></description>
		<content:encoded><![CDATA[<p>sir, how to local db upload in my server Db</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ravi</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-181390</link>
		<dc:creator><![CDATA[Ravi]]></dc:creator>
		<pubDate>Fri, 21 Oct 2011 03:20:04 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-181390</guid>
		<description><![CDATA[hi,

I want to know how to find out a record from a database if we dont know the table name. 

eg. find out the record in which  (field name / Attribute) city = &#039;hyderabad&#039; in mydatabase.]]></description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>I want to know how to find out a record from a database if we dont know the table name. </p>
<p>eg. find out the record in which  (field name / Attribute) city = &#8216;hyderabad&#8217; in mydatabase.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-179862</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Mon, 17 Oct 2011 09:48:45 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-179862</guid>
		<description><![CDATA[Why do you want to do without a join? If the dept table has empid column, you can do this

select (select dname from dept where empid=t.empid), ename from emp as t]]></description>
		<content:encoded><![CDATA[<p>Why do you want to do without a join? If the dept table has empid column, you can do this</p>
<p>select (select dname from dept where empid=t.empid), ename from emp as t</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: goburaj</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-179111</link>
		<dc:creator><![CDATA[goburaj]]></dc:creator>
		<pubDate>Sat, 15 Oct 2011 05:04:12 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-179111</guid>
		<description><![CDATA[sir i want dname and ename from emp and dept 
without using join .the result set is (ename,dname)]]></description>
		<content:encoded><![CDATA[<p>sir i want dname and ename from emp and dept<br />
without using join .the result set is (ename,dname)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: guna</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-178615</link>
		<dc:creator><![CDATA[guna]]></dc:creator>
		<pubDate>Fri, 14 Oct 2011 04:55:42 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-178615</guid>
		<description><![CDATA[Sir,, I Have two tables date, join the record two table record in date wise but 

first table record cout 10 and secord table record count 500 match two table date wise without duplication and null values 

How do Please Help me Sir...]]></description>
		<content:encoded><![CDATA[<p>Sir,, I Have two tables date, join the record two table record in date wise but </p>
<p>first table record cout 10 and secord table record count 500 match two table date wise without duplication and null values </p>
<p>How do Please Help me Sir&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-177976</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 12 Oct 2011 13:48:43 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-177976</guid>
		<description><![CDATA[Have you tried using a LEFT JOIN?]]></description>
		<content:encoded><![CDATA[<p>Have you tried using a LEFT JOIN?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: guna</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-177914</link>
		<dc:creator><![CDATA[guna]]></dc:creator>
		<pubDate>Wed, 12 Oct 2011 10:13:45 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-177914</guid>
		<description><![CDATA[Sir , This Is My Query

With OrderedFoos As
(Select row_number() over (order by Bill Asc) RowNum, Bill,BillDate,Partyname,Vat,Tax From Purchase Where BillDate Between &#039;09-01-2011&#039; And &#039;10-30-2011&#039; And Tax=&#039;0&#039;),
OrderedBars as (Select row_number() over (order by Bill Asc) RowNum, Bill,BillDate,Partyname,Vat,Tax From Sales Where BillDate Between &#039;09-01-2011&#039; And &#039;10-30-2011&#039; And Tax=&#039;0&#039;)
Select  P.Bill PBILL,P.BillDate PBillDate,P.Partyname PParty,P.Vat PVat,S.Bill SBILL,S.BillDate SBillDate,S.Partyname SParty,S.Vat SVat From 
OrderedFoos P Inner join   OrderedBars S  on  P.RowNum=S.RowNum


.. Working But Purchase table 10 Rows ,Sales Table 5 Row .. this query retriving first 5 records only but i have purchase table 10 rows and sales table 5 rows without duplication ... how do ...  Please Help Me.......]]></description>
		<content:encoded><![CDATA[<p>Sir , This Is My Query</p>
<p>With OrderedFoos As<br />
(Select row_number() over (order by Bill Asc) RowNum, Bill,BillDate,Partyname,Vat,Tax From Purchase Where BillDate Between &#8217;09-01-2011&#8242; And &#8217;10-30-2011&#8242; And Tax=&#8217;0&#8242;),<br />
OrderedBars as (Select row_number() over (order by Bill Asc) RowNum, Bill,BillDate,Partyname,Vat,Tax From Sales Where BillDate Between &#8217;09-01-2011&#8242; And &#8217;10-30-2011&#8242; And Tax=&#8217;0&#8242;)<br />
Select  P.Bill PBILL,P.BillDate PBillDate,P.Partyname PParty,P.Vat PVat,S.Bill SBILL,S.BillDate SBillDate,S.Partyname SParty,S.Vat SVat From<br />
OrderedFoos P Inner join   OrderedBars S  on  P.RowNum=S.RowNum</p>
<p>.. Working But Purchase table 10 Rows ,Sales Table 5 Row .. this query retriving first 5 records only but i have purchase table 10 rows and sales table 5 rows without duplication &#8230; how do &#8230;  Please Help Me&#8230;&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: newuser</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-167489</link>
		<dc:creator><![CDATA[newuser]]></dc:creator>
		<pubDate>Mon, 12 Sep 2011 11:25:21 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-167489</guid>
		<description><![CDATA[Hi, I have an issue where i cannot joing two tables but i need to get the data from both of them. I can achieve this by using cross join or by inline query. But which eats the performance. So wanted to know is there any alternatives for the same.

Table 1 contains required data say  country names , region etc (no id&#039;s) and the data is DB language specific. It may be in english in for one customer and German for another customer.

I need to write a logic where if countryname=&#039;India&#039; then 1 else 0 kind of thing.
But as i said the values are in different lanaguages in differet DB i cannot compare this with harcoded text called &#039;India&#039;

For that i have created another table Table 2 which contains data like country name  in all the languages and language code.
So i am writing query like below

select  case when test.countryname=test.b then 1 else 0 end
from
(
select if Table1.countryname,(select table2.country name from table1 where language code=@parameter)b
) test

This is giving the required results but i have 100 such columns where i need to do the comparison. Is there any better way to achieve this

Thanks in advance]]></description>
		<content:encoded><![CDATA[<p>Hi, I have an issue where i cannot joing two tables but i need to get the data from both of them. I can achieve this by using cross join or by inline query. But which eats the performance. So wanted to know is there any alternatives for the same.</p>
<p>Table 1 contains required data say  country names , region etc (no id&#8217;s) and the data is DB language specific. It may be in english in for one customer and German for another customer.</p>
<p>I need to write a logic where if countryname=&#8217;India&#8217; then 1 else 0 kind of thing.<br />
But as i said the values are in different lanaguages in differet DB i cannot compare this with harcoded text called &#8216;India&#8217;</p>
<p>For that i have created another table Table 2 which contains data like country name  in all the languages and language code.<br />
So i am writing query like below</p>
<p>select  case when test.countryname=test.b then 1 else 0 end<br />
from<br />
(<br />
select if Table1.countryname,(select table2.country name from table1 where language code=@parameter)b<br />
) test</p>
<p>This is giving the required results but i have 100 such columns where i need to do the comparison. Is there any better way to achieve this</p>
<p>Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: imran</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-163765</link>
		<dc:creator><![CDATA[imran]]></dc:creator>
		<pubDate>Tue, 30 Aug 2011 23:59:57 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-163765</guid>
		<description><![CDATA[Look like this inner join both table 
SELECT E.ENAME, E.JOB,E.SAL, D.DNAME,D.LOC
FROM EMP E JOIN DEPT D
ON (E.DEPTNO=D.DEPTNO);]]></description>
		<content:encoded><![CDATA[<p>Look like this inner join both table<br />
SELECT E.ENAME, E.JOB,E.SAL, D.DNAME,D.LOC<br />
FROM EMP E JOIN DEPT D<br />
ON (E.DEPTNO=D.DEPTNO);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-149602</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 20 Jul 2011 13:38:50 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-149602</guid>
		<description><![CDATA[Use inner join

select t1.* from table1 as t1 inner join table2 as t2 on t1.common_col=t2.common_col]]></description>
		<content:encoded><![CDATA[<p>Use inner join</p>
<p>select t1.* from table1 as t1 inner join table2 as t2 on t1.common_col=t2.common_col</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Crobin Be</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-149562</link>
		<dc:creator><![CDATA[Crobin Be]]></dc:creator>
		<pubDate>Wed, 20 Jul 2011 09:02:36 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-149562</guid>
		<description><![CDATA[I have Two tables in same database.Both table has a common column.Each columns has value like this (1,2,3).So How can i get value from one table matching both tables with common field.Any suggest me with query.]]></description>
		<content:encoded><![CDATA[<p>I have Two tables in same database.Both table has a common column.Each columns has value like this (1,2,3).So How can i get value from one table matching both tables with common field.Any suggest me with query.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chitralekha</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-136411</link>
		<dc:creator><![CDATA[chitralekha]]></dc:creator>
		<pubDate>Tue, 24 May 2011 14:12:36 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-136411</guid>
		<description><![CDATA[hello ,
I am new to your blog, but i found it really helping. I also have a query. i have two tables rib_entry(date,amtcash,amtcheque,total) and bank_entry(date,amtcredited,total) now i need to print a report where amtcredited=amtcash or amtcredited=amtcheque. the two table have many to many relationship. the question is how can i join them to show matching records only on their first occurence on date basis, and they should not be matched twice.
i.e. if on 11/01/2010 amtcash=10000 and on 11/02/2010 amtcredited=10000 and on 11/02/2010 also amtcredited=10000 so the report should match 11/01/2010 amtcash to 11/02/2010 amtcredited only.]]></description>
		<content:encoded><![CDATA[<p>hello ,<br />
I am new to your blog, but i found it really helping. I also have a query. i have two tables rib_entry(date,amtcash,amtcheque,total) and bank_entry(date,amtcredited,total) now i need to print a report where amtcredited=amtcash or amtcredited=amtcheque. the two table have many to many relationship. the question is how can i join them to show matching records only on their first occurence on date basis, and they should not be matched twice.<br />
i.e. if on 11/01/2010 amtcash=10000 and on 11/02/2010 amtcredited=10000 and on 11/02/2010 also amtcredited=10000 so the report should match 11/01/2010 amtcash to 11/02/2010 amtcredited only.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fayaz</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-127334</link>
		<dc:creator><![CDATA[Fayaz]]></dc:creator>
		<pubDate>Thu, 07 Apr 2011 09:46:21 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-127334</guid>
		<description><![CDATA[Hi,
can any one help me...i want to eliminet the duplicate values while using INNER JOIN 

This is the code.

SELECT DISTINCT H1.EMP_CODE,H1.NAME1A+&#039;  &#039;+H1.NAME2A+&#039;  &#039;+H1.NAME3A &#039;NAME&#039;
,H2.DESCA &#039;JOB&#039;
,H3.DESCA &#039;COUNTRY&#039;
,H4.DESCA &#039;JOB&#039;
FROM H_EMP H1 INNER JOIN H_D_JOB H2
ON H1.JOB_CODE=H2.CODE 
INNER JOIN H_D_NATIONALITY H3
ON H1.NAT_CODE=H3.CODE
INNER JOIN H_D_DEPARTMENT H4
ON H1.DEP_CODE=H4.CODE ORDER BY EMP_CODE]]></description>
		<content:encoded><![CDATA[<p>Hi,<br />
can any one help me&#8230;i want to eliminet the duplicate values while using INNER JOIN </p>
<p>This is the code.</p>
<p>SELECT DISTINCT H1.EMP_CODE,H1.NAME1A+&#8217;  &#8216;+H1.NAME2A+&#8217;  &#8216;+H1.NAME3A &#8216;NAME&#8217;<br />
,H2.DESCA &#8216;JOB&#8217;<br />
,H3.DESCA &#8216;COUNTRY&#8217;<br />
,H4.DESCA &#8216;JOB&#8217;<br />
FROM H_EMP H1 INNER JOIN H_D_JOB H2<br />
ON H1.JOB_CODE=H2.CODE<br />
INNER JOIN H_D_NATIONALITY H3<br />
ON H1.NAT_CODE=H3.CODE<br />
INNER JOIN H_D_DEPARTMENT H4<br />
ON H1.DEP_CODE=H4.CODE ORDER BY EMP_CODE</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-118638</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Tue, 15 Feb 2011 15:29:23 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-118638</guid>
		<description><![CDATA[select a.id from a inner join b on a.id=b.value]]></description>
		<content:encoded><![CDATA[<p>select a.id from a inner join b on a.id=b.value</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mukesh</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-118018</link>
		<dc:creator><![CDATA[Mukesh]]></dc:creator>
		<pubDate>Fri, 11 Feb 2011 12:56:22 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-118018</guid>
		<description><![CDATA[Hi,
I have two tables in the same DB say A and B but there are no common column.
but i suspect that some data are common.
A.id = 1,2,3.....
B.Value = 1,2,3

Is there a way to find the common data in these tables??]]></description>
		<content:encoded><![CDATA[<p>Hi,<br />
I have two tables in the same DB say A and B but there are no common column.<br />
but i suspect that some data are common.<br />
A.id = 1,2,3&#8230;..<br />
B.Value = 1,2,3</p>
<p>Is there a way to find the common data in these tables??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: falguni</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-77897</link>
		<dc:creator><![CDATA[falguni]]></dc:creator>
		<pubDate>Mon, 28 Jun 2010 12:17:55 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-77897</guid>
		<description><![CDATA[Hi ,

I have 3 tables A,B and C  where a , b and c have column name id , a .id is  primary key , b.id and c.id is foreign key of a.id.

For example 
A .Id    has values 1,2,3,4
B.id    has values like  1,1,1,1,2,3,3,3,4
C.id has values like  1,1,2,2,3,3,4


I want result like
a.id    b.id      c.id
1           1        1
1           1        1
1           1         null
1           1         null
2           2         2
2           null      2
3           3        3
3           3        3
3           3        null
4           4         4


Please Help me...]]></description>
		<content:encoded><![CDATA[<p>Hi ,</p>
<p>I have 3 tables A,B and C  where a , b and c have column name id , a .id is  primary key , b.id and c.id is foreign key of a.id.</p>
<p>For example<br />
A .Id    has values 1,2,3,4<br />
B.id    has values like  1,1,1,1,2,3,3,3,4<br />
C.id has values like  1,1,2,2,3,3,4</p>
<p>I want result like<br />
a.id    b.id      c.id<br />
1           1        1<br />
1           1        1<br />
1           1         null<br />
1           1         null<br />
2           2         2<br />
2           null      2<br />
3           3        3<br />
3           3        3<br />
3           3        null<br />
4           4         4</p>
<p>Please Help me&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/10/17/sql-server-get-common-records-from-two-tables-without-using-join/#comment-63245</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Fri, 19 Mar 2010 08:06:19 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1380#comment-63245</guid>
		<description><![CDATA[You can using all the tables and use bcp
Read about bcp in SQL Server help file for more informations]]></description>
		<content:encoded><![CDATA[<p>You can using all the tables and use bcp<br />
Read about bcp in SQL Server help file for more informations</p>
]]></content:encoded>
	</item>
</channel>
</rss>

