Subject Re: Multiselect or something like that
Author majstoru
Hi,

Here is a closer explanation of my problem, it is something like
cross query (like MS Access)!

If I have 3 tables Customers, Articles and Qty with metadata:

1. Articles
id smallint
name varchar

2. Customers
id smallint
name varchar
city varchar

3. Qty
id smallint
art_id smallint
cust_id smallint
qty integer

So, that is a metadata and I must return something like:

X -> Articles
y -v Customers

Art01 Art02 Art03 . . .
Cust01 Qty1 Qty5 Qty3
Cust02 Qty9 Qty7 Qty2
Cust03 Qty1 Qty1 Qty1
.
.
.

And. At the end of these process of my problem, this query must be
UPDATEABLE!!!

I think that is a little closer that previous sample!!!

Thanks

--- In firebird-support@yahoogroups.com, "Rick Debay" <rdebay@...>
wrote:
>
> You can begin by changing the database. What happens if you need
to have 101 articles for a customer?
> Assuming a CUSTOMER table and an ARTICLE table, create a third
table with at least two columns. The first is a foreign key to the
CUSTOMER table, and the second is a foreign key to the ARTICLE table
(you can have other columns with timestamps, why the link was made,
etc; the usual meta-data).
>
> This suggestion may be incorrect, I don't understand the number in
the fields, is this the number of times a customer has read an
article? If so, that can be another column in the table that links
the two.
>
> -----Original Message-----
> From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of majstoru
> Sent: Tuesday, June 13, 2006 3:36 PM
> To: firebird-support@yahoogroups.com
> Subject: [firebird-support] Multiselect or something like that
>
> Hi,
>
> Here is one interest situation. I have input form:
>
> A01 A02 A03 A04 A05
> Cust01 10 20 30 40 50
> Cust02 15 10 15 10 20
> Cust03 10 30 50 50 30
> Cust04 5 3 2 1 10
>
> In this sample A01-A05 are some articles, and Cust01-Cust04 are
customers, the numbers in the midle are connection between articles
and customers!
> I have a few questions for the Firebird experts:
> 1. Is there eny SQL statement which will help me to find an
article into table with out CASE statement or somethnig like that,
because number of articles can be up to 100 article (table have 100
columns) 2. If I have few tables and article A05 which is on the 4
column into first table, 2 column into secound table, 10 column ...
how to summariye all of this into one SQL statement.
>
> Maybe it is a little complicated but here is a problem, if there
is some solution that will be great.
>
> Thanks ... :-)
>
>
>
>
>
> ------------------------ Yahoo! Groups
Sponsor --------------------~--> Everything you need is one click
away.  Make Yahoo! your home page now.
> http://us.click.yahoo.com/AHchtC/4FxNAA/yQLSAA/67folB/TM
> --------------------------------------------------------------------~->
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>