這是我的查詢MySQL查詢,ALL ABOUT CONCAT
SELECT PART_NUM,DESCRIPTION, CONCAT('$',(ON_HAND*PRICE)) AS ON_HAND_VALUE
FROM part WHERE CLASS ='AP'
但是當我試圖查詢它,我的回答將永遠equall $ 0,它像(ON_HAND *價格)不工作
這些都是值:
Microwave Oven == 32*$165 GAS RANGE == 8*495 DISHWASHER ==8*595 DRYER ==12*349.95 WASHER ==128399.99
這一定是結果:
PART_NUM----DESCRIPTION ---------ON_HAND_VALUE CD52 -----------MICROWAVE OVEN----$5280 DR93----------- GAS RANGE----------- $3960 KT03----------- DISHWASHER----------- $4760 KL62----------- DRYER----------- $41994.4 DW11----------- WASHER----------- $4799.88
什麼是'ON_HAND','PRICE'領域的DATA_TYPE? – bpgergo
@bpgergo ON_HAND是int並且價格是varchar – LittleMissChoco
@bpgergo ...請幫助:( – LittleMissChoco