sql weirdness
Dave Parizek
dave at Parizek.com
Sun Jan 18 14:06:17 CST 2004
>on 1/18/04 12:07 AM, Dave Parizek at dave at Parizek.com wrote:
>
>> Ok, so this works:
>>
>> SELECT ProductName,PriceThere,UsedPrice FROM Item, Venue, Product
>> where (Item.ItemProductPtr = Product.RecID) and (VenueItemPtr =
>> Item.RecID) and (PriceThere = UsedPrice)
>>
>> but if I change the last '=' to a '>' or '<' it does not work, I get
>> an error 616, wrong expression:
>>
> > SELECT ProductName,PriceThere,UsedPrice FROM Item, Venue, Product
>> where (Item.ItemProductPtr = Product.RecID) and (VenueItemPtr =
> > Item.RecID) and (PriceThere > UsedPrice)
>>
>> What am I doing wrong?
>
>Hi Dave,
>
>Valentina 1.x support JOIN by
>
> WHERE A.key = B.ptr
>
I'm confused. I'm not trying to do a join exactly. I have 3 tables.
Product is joined to Item one to many. Item is joined to Venue one
to many. Product and Venue are not joined except thru Item.
Now I want the Venue records where Venue.PriceThere is greater than
Product.UsedPrice. In my where clause above, the first 2 items join
the tables, and theoretically are unnecessary since I am using object
pointers and Valentina can figure out the relations by itself. The
3rd item in the where clause is where I am attempting to limit the
records, not do a join.
If I have 3 tables can I not do that? eg.: If A.key = B.ptr and
B.key=C.ptr, and I want to select out the records where C.price <
A.price, how do I write that with Valentina?
Or do I have to directly relate A to C?
If not Valentina 1.x, will 2.0 be able to do this?
--Dave
--
_______________________________________________
Dave Parizek
Bookseller
Dave at Parizek.com
More information about the Valentina
mailing list