Where is the availability flag? Is it simply if it exists in a shop? 

-----Original Message-----
From: Justin [mailto:[EMAIL PROTECTED] 
Sent: 05 January 2004 14:54
To: Cfuk
Subject: [ cf-dev ] stupid sql question

My brain is still in xmas mode, and what should be simple sql is a
challange!

I want to do a query, that lists all the products , with a column with a
yes/no (boolean/bit) column to say if the product is available in that shop
or not

so with

[Product]
pk      product
------------------
1       product1
2       product2
3       product3

[Shop]
pk      shop
--------------
1       shop_1
2       shop_2


[ShopProduct]
FKProduct       FKShop
-------------------
1               1
1               2
2               1
3               2


I should have

Shop            product available
------------------------------
shop_1  product1        yes
shop_1  product2        yes
shop_1  product3        no
shop_2  product1        yes
shop_2  product2        no
shop_2  product3        yes

I know its a CROSS JOIN between shop and product with a outer? join on the
ShopProduct table but just can't get it together...

Thanks

Justin




--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] For human
help, e-mail: [EMAIL PROTECTED]
This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions.
Visit our website at http://www.reedexpo.com

-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to