Reply to Re: SQL - how to - I need a query solution, no coding....

Your name:

Reply:


Posted by David Portas on 11/01/07 21:22

"Radu" <cuca_macaii2000@yahoo.com> wrote in message
news:1193950837.684135.229810@o3g2000hsb.googlegroups.com...
> Hi. I'm looking at a problem and I can't find any solution short of
> coding.
>
> I have a pool of, say, 1000 PINS. I have 7 tables (buckets). Any of
> the 1000 PINS can be in 0, 1, 2, or... or all 7 buckets. So let's say
> that
>
> -bucket A has 100 PINS
> -bucket B has 300 PINS
> -bucket C has 600 PINS
> -bucket D has 200 PINS
> -bucket E has 500 PINS
> -bucket F has 350 PINS
> -bucket G has 700 PINS
>
> I need to know, for each PIN, the number of buckets (tables) it
> belongs to, and which ones, i.e:
> - PIN 1 belongs to A, C, D, so it belongs to 3 buckets
> - PIN 2 belongs to A, C, D, F, so it belongs to 4 buckets
> - PIN 3 belongs to A, so it belongs to 1 bucket
> - PIN 4 belongs to A, B, C, D, G, so it belongs to 5 buckets
> - PIN 5 belongs to ..., so it belongs to 0 buckets
> etc, etc
>
> What would be the simplest way to achieve that, please ?
>
> Thank you very much
> Alex.
>

Why would you use seven tables to represent this information? There may be a
valid reason but without at least more info on keys I don't know. This looks
suspiciously like homework so rather than complete a solution for you I'll
suggest that you think about a UNION or a JOIN.

--
David Portas

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация