RE: LEFT SELF Join -- LEFT join on same table

2003-07-14 Thread Kevin Fries
To perform a self-join you just have to alias one or both tables. In your case, you want to join on ( I guess) the SLM + CUST + ITEM, restricting the tables to, respectively, 2003 and 2002. Further, you want to filter out any rows where there's a match in 2002. I believe the following does it: s

Re: LEFT SELF Join -- LEFT join on same table

2003-07-14 Thread O'K Web Design
Hi Let me take a stab at it. I don't think you need a join at all. Check the syntax but I think you can do it like this. SELECT *,concat(slm,item,cust,year) as result1,concat(slm,item,cust,2003) as result2 from sales where result1!=result2 AND date>2001 year would be taken from your date