Page 1 of 1

Need to select values as aliases?

Posted: Wed Jul 11, 2007 11:36 am
by Luke
I have this query:

Code: Select all

SELECT 
    s01_CFM_ProdValues.value,
    s01_CFM_ProdFields.code
FROM 
    s01_CFM_ProdFields,
    s01_CFM_ProdValues,
    s01_Products
WHERE
    s01_CFM_ProdValues.product_id = s01_Products.id
AND
    s01_CFM_ProdValues.field_id = s01_CFM_ProdFields.id
AND
    s01_Products.code = 'ELL001A'
AND
    s01_CFM_ProdFields.code IN ('color','mfcd')
It returns exactly the information I need, but not really how I need it. It returns this:

Code: Select all

value   code (column names)
Blue    COLOR
ELL     MFCD
And I need it to return this:

Code: Select all

COLOR   MFCD (column names)
Blue    ELL
Any idea how I can do that?

Posted: Wed Jul 11, 2007 2:39 pm
by feyd
I'm pretty sure you'll have to do the rotation yourself.

Posted: Wed Jul 11, 2007 2:47 pm
by Luke
that's what I figured... but I had to check. I am no sql guru. thanks feyd. :)

unfortunately I have to do it in mivascript... grumble grumble... :evil:

I HATE MIVASCRIPT