Link to home
Start Free TrialLog in
Avatar of Tony Pearce
Tony PearceFlag for United Kingdom of Great Britain and Northern Ireland

asked on

My SQL Query, append text to a result and add new default results??

Hi,
I have this query( in code box):

The line:
xcart_products.productid AS link
I actually need to add 'http://www.mydomain.com/product.php?id=' before to returned number.

I also need to add an extra colum with todays date automatically added??

I would normally add these on the page but this is being exported directly form Navicat to an CSV file.

Help!!!!!!!!!
Tony


SELECT
xcart_products.productcode AS id,
xcart_products.product AS title,
xcart_products.list_price*1.15 AS price,
xcart_products.descr AS description,
xcart_products.avail AS quantity,
xcart_products.forsale,
xcart_products.weight AS weight,
xcart_categories.category AS product_type,
xcart_manufacturers.manufacturer AS brand,
xcart_quick_flags.image_path_T AS image_link,
xcart_products.productid AS link
FROM
xcart_products
Inner Join xcart_products_categories ON xcart_products_categories.productid = xcart_products.productid
Inner Join xcart_categories ON xcart_categories.categoryid = xcart_products_categories.categoryid
Inner Join xcart_manufacturers ON xcart_manufacturers.manufacturerid = xcart_products.manufacturerid
Inner Join xcart_quick_flags ON xcart_quick_flags.productid = xcart_products.productid

Open in new window

Avatar of theGhost_k8
theGhost_k8
Flag of India image

you can surely use concat function:

select concat( 'http://www.mydomain.com/product.php?id=' ,FIELDNAME) as aliasfieldname .....
Avatar of Tony Pearce

ASKER

that works great, thanks, any idea how to add a new column result with a default value??
Tony
couldn't get the question:
Do u mean adding  to table?
ALTER TABLE tablename MODIFY colNAME <DATATYPE> DEFAULT <VALUE>;
Sorry, I'm not being clear...

I am producing a froogle feed from Navicat, unfortunatly the database does not have all the fields required, so when running the query I need to output extra results set to a default value...
ASKER CERTIFIED SOLUTION
Avatar of theGhost_k8
theGhost_k8
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thats it,

Thanks so much.......
Thanks so much.....