January 10, 2019 at 2:53 pm
Hello DistinguishedThey could help me with this case, I have a column that shows the sales of each client. This is in a table. But I want to evaluate the result of the sale with another table that has the ranges of sales, which gives the level of it.
Thanks
January 10, 2019 at 3:05 pm
Your ranges have gaps: where would 500,000.50 fall?
At any rate, something like:
SELECT s.sales, ss.Nota
FROM sales s
LEFT OUTER JOIN sales_setup ss ON s.sales BETWEEN ss.rango_inf AND ss.rango_sup
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
January 11, 2019 at 1:21 pm
ScottPletcher - Thursday, January 10, 2019 3:05 PMYour ranges have gaps: where would 500,000.50 fall?At any rate, something like:
SELECT s.sales, ss.Nota
FROM sales s
LEFT OUTER JOIN sales_setup ss ON s.sales BETWEEN ss.rango_inf AND ss.rango_sup
Thanks Very Much!! I work perfectly!!
January 11, 2019 at 2:11 pm
angelreynosog - Friday, January 11, 2019 1:21 PMScottPletcher - Thursday, January 10, 2019 3:05 PMYour ranges have gaps: where would 500,000.50 fall?At any rate, something like:
SELECT s.sales, ss.Nota
FROM sales s
LEFT OUTER JOIN sales_setup ss ON s.sales BETWEEN ss.rango_inf AND ss.rango_supThanks Very Much!! I work perfectly!!
It would except you didn't answer his question... you have gaps in your ranges... that needs to be repaired.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 13, 2019 at 4:50 am
Jeff Moden - Friday, January 11, 2019 2:11 PMangelreynosog - Friday, January 11, 2019 1:21 PMScottPletcher - Thursday, January 10, 2019 3:05 PMYour ranges have gaps: where would 500,000.50 fall?At any rate, something like:
SELECT s.sales, ss.Nota
FROM sales s
LEFT OUTER JOIN sales_setup ss ON s.sales BETWEEN ss.rango_inf AND ss.rango_supThanks Very Much!! I work perfectly!!
It would except you didn't answer his question... you have gaps in your ranges... that needs to be repaired.
+1, but I don't think the OP gets it!
...
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply