Groups | Blog | Home
all groups > sql server programming > september 2003 >

sql server programming : query help



Bite My Bubbles
9/4/2003 10:58:42 PM
Stumped again:

How do I create a query that selects all itemNO where the cost changed, then
changed back?

In this example I would want >all< records where itemNO equals 3 but not 4

sigh

create table test1 ( idno int NOT NULL IDENTITY (1, 1),
itemNo int,
cost money,
thisdate datetime)

insert into test1 (itemNo, cost, thisdate) values(3, 55,'3/13/03')
insert into test1 (itemNo, cost, thisdate) values(3, 55,'3/13/03')
insert into test1 (itemNo, cost, thisdate) values(3, 56,'3/16/03')
insert into test1 (itemNo, cost, thisdate) values(3, 55,'3/17/03')
insert into test1 (itemNo, cost, thisdate) values(3, 58,'3/17/03')

insert into test1 (itemNo, cost, thisdate) values(4, 76,'3/17/03')
insert into test1 (itemNo, cost, thisdate) values(4, 76,'3/20/03')
insert into test1 (itemNo, cost, thisdate) values(4, 77,'3/21/03')
select * from test1
drop table test1



I really appreciate it

Bite My Bubbles
9/5/2003 12:14:01 AM
I might be missing the point too, but why would you think that???
4???

How do I create a query that selects all itemNO where the cost changed,
then changed back?

The only records that satisfy this query are records with itemNO =3 (with
the data that I provided)

But what would the query be?



[quoted text, click to view]

Jack Vamvas
9/5/2003 5:25:55 AM

[quoted text, click to view]
I might be missing the point but do you mean , select * from test1 where
itemNo = 4 ?

JV
--
___________________________________________________________________
Remotely manage MS SQL db with SQLdirector -
www.ciquery.com/tools/sqldirector/

AddThis Social Bookmark Button