turdi Posted February 15, 2017 Share Posted February 15, 2017 Hello, First of all, sorry about the basic question, but I'm pretty bad at forming the SQL queries... I have a simple query to get the id and qty, but in this case I need to add a prefix to all the ID's. SELECT p.id_product, p.quantity FROM ps_product p GROUP BY p.id_product I've tryed CONCAT('v4',p.id_product) as p.id_product but with no luck. Trying to learn and understand how it works. Thanks you!!! Link to comment Share on other sites More sharing options...
JeredBolton Posted February 16, 2017 Share Posted February 16, 2017 (edited) It doesn't work because you're trying to output the concatenated string AS an existing table column. Call it something different and it will work fine: SELECT p.id_product, p.quantity, CONCAT('v4',p.id_product) AS new_id_product FROM ps_product p GROUP BY p.id_product Edited February 16, 2017 by JeredBolton (see edit history) Link to comment Share on other sites More sharing options...
turdi Posted March 21, 2017 Author Share Posted March 21, 2017 Thank you !! One more question, do you know in witch table I can find the Final price value? I can't find it in the database... I have found base price in ps_product table, but can't find the final price... Thank you!! Link to comment Share on other sites More sharing options...
bellini13 Posted March 21, 2017 Share Posted March 21, 2017 define 'final price' ? Link to comment Share on other sites More sharing options...
musicmaster Posted March 22, 2017 Share Posted March 22, 2017 If you mean price+VAT with final price you won't find it. It is a calculated value. Prices after discounts too are calculated values that aren't stored as such in the database. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now