Viewing 9 posts - 1 through 9 (of 9 total)
ChazMan (3/2/2011)
Look at using the Rank() function and select a RanK() <= 3.
Rank is not an option in the Filters -> Operator section. I need to be able to...
March 2, 2011 at 12:44 pm
Dave Ballantyne (3/1/2011)
Another option
select Oid
from orders
group by oid
having MAX(item) = MIN(item)
and MIN(item) = '1063'
This works but does not handle teh scenario where the item is null. In such a...
March 2, 2011 at 9:00 am
The query did not need to be as complex as you have asked. It was just to find orders that have ALL the same of item 1063. ColdCOffee...
March 1, 2011 at 12:27 pm
ColdCoffee (3/1/2011)
select *
from orders outer_table
where itemid = '1063'
and not exists ( select 1 from orders inner_table
...
March 1, 2011 at 12:25 pm
Craig Farrell (3/1/2011)
insert into orders (oid, itemid)
values (1,'1063')
insert into orders (oid, itemid)
values (1,'1063')
insert into orders (oid, itemid)
values (1,'1064')
insert into orders (oid, itemid)
values (2,'1063')
insert into orders (oid, itemid)
values (2,'1063')
insert into orders...
March 1, 2011 at 12:00 pm
Thanks that worked great. Appreciate the tip on how to post. Will do that going forward.
November 30, 2010 at 1:51 pm
Thanks Nagesh! That worked like a charm 😀
May 7, 2010 at 7:23 am
Hi
I understand what you're saying completely. Did not mean to annoy anyone. I did understand the code, and I did add the date to the grouping clauses in...
May 7, 2010 at 7:21 am
Hi that worked great for the example i provided. If i add another requirement into the mix what would the SQL look like?
SEQUENCE,PRODUCT,TIME,PRICE
1,Spoon1,2010-05-05 08:30:00.000,83.50
2,Spoon1,2010-05-05 08:31:01.000,80.00
3,Spoon1,2010-05-05 08:32:02.000,81.00
4,Spoon1,2010-05-05 08:33:03.000,82.00
5,Fork1,2010-05-05 08:31:01.00,90.50
6,Fork1,2010-05-05 08:32:02.000,90.00
7,Fork1,2010-05-05...
May 6, 2010 at 1:06 pm
Viewing 9 posts - 1 through 9 (of 9 total)