I'm trying to do the impossible I think but what I'd like to do is join
two tables, using the "colname" results from "a" table to lookup a
column named "colname" in b...  here we go.

suppose we have

table a:
        id      colname
        0       price1
        1       price2
        2       price3

table b
        item    price1  price2  price3
        x       1.50    2.50    3.50
        y       2.50    3.50    4.50

what I'd like to do, is 

select b.`a.colname` from a, b where a.id=0 and b.item="x";

which should result in 1.50 (a.id=0, a.colname="price1", b.item="x",
b.price1)

I know.. crazy.  Not normal.  can I do it though?  I don't even know
what to call it.. otherwise I could look it up.  (The formal name is
probably "Illegal SQL!")

Please reply directly, as I am not a member of the list.
Roger


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to