August 1, 2008 at 4:27 am
Hi I am new to sql so sorry if im asking a basic question.
I want to compare my competitors pricing table call it comppricing with my own pricing table mypricing
and generate a new table or view based on a couple of variables
1. Amount I can beat the competitors pricing by eg £10
and
2. the amount I wish to be below my competitor. eg £5 or 1%
Thanks for any help
John.
August 1, 2008 at 4:36 am
Hi John
It's going to look something like this:
SELECT m.ProductID, m.ProductName, m.Price, t.Price
FROM MyPricingTable m
LEFT JOIN TheirPricingTable t ON t.ProductID = m.ProductID
WHERE t.Price - m.Price > 20
There's very little information to work with; you won't get an answer straight away, instead you will get a barrage of questions until enough is known about your problem. The following link provides guidelines on how to post a question to get an answer quickly:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Cheers
ChrisM
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply