mysql group by not doing what i am expecting?
I have this query:

	SELECT
		  bp.product_id,bs.step_number,
		  p.price, pd.name as product_name
		FROM 
		  builder_product bp
		  JOIN builder_step bs ON bp.builder_step_id = bs.builder_step_id
		  JOIN builder b ON bp.builder_id = b.builder_id
		  JOIN product p ON p.product_id = bp.product_id
		  JOIN product_description pd ON p.product_id = pd.product_id
		  WHERE b.builder_id = '74' and bs.optional != '1'
		ORDER by bs.step_number, p.price

which is returning 

		88	1	575.0000	Lenovo Thinkcentre POS PC
		92	1	799.0000	Lenovo Thinkcenter Server - RAID Configured
		31	1	1599.0000	All-In-One - Lenovo Thinkcentre 23&quot;
		63	2	169.0000	Lenovo Thinkvision 18.5&quot; - LCD
		62	2	249.0000	Lenovo Thinkvision 22&quot; - LCD
		244	2	559.0000	Touchscreen with MSR - Firebox 15&quot;
		104	3	285.0000	Remote Order Printer - Epson
		65	3	355.0000	Barcode and Label Printer - Zebra 2&quot; TT
		68	3	399.0000	Barcode And Label Printer - Zebra 4&quot; DT
		254	4	106.0000	Cash Drawer - APG - 14X16 - Black
		251	4	195.0000	Cash Drawer - APG - 16X16 - Serial
		97	4	395.0000	Aldelo Lite
		97	5	395.0000	Aldelo Lite
		121	5	549.0000	Cash Register Express  - Pro
		279	5	849.0000	Aldelo Premium
		135	6	0.0000  	Free!! Payment Processing Software
		191	6	349.0000	Integrated Payment Processing
		231	7	0.0000	  1 User/Location - 8Am - 8Pm Mon - Fri Support Plan - Level 1
		232	7	0.0000	  1 User/Location - 24 X 7 X 365 Support Plan - Level 1
		155	7	369.0000	Accessory - Posiflex 12.1&quot; LCD Customer Display


what i need is the lowest price from each step so i assumed adding the group by would work 


	SELECT
		  bp.product_id,bs.step_number,
		  p.price, pd.name as product_name
		FROM 
		  builder_product bp
		  JOIN builder_step bs ON bp.builder_step_id = bs.builder_step_id
		  JOIN builder b ON bp.builder_id = b.builder_id
		  JOIN product p ON p.product_id = bp.product_id
		  JOIN product_description pd ON p.product_id = pd.product_id
		  WHERE b.builder_id = '74' and bs.optional != '1'
		group by bp.step_number
		ORDER by bs.step_number, p.price

but here is my results

	88	1	575.0000	Lenovo Thinkcentre POS PC
	244	2	559.0000	Touchscreen with MSR - Firebox 15&quot;
	104	3	285.0000	Remote Order Printer - Epson
	97	4	395.0000	Aldelo Lite
	121	5	549.0000	Cash Register Express  - Pro
	191	6	349.0000	Integrated Payment Processing
	155	7	369.0000	Accessory - Posiflex 12.1&quot; LCD Customer Display

as you can see its wrong because on step 2 I should have 

		63	2	169.0000	Lenovo Thinkvision 18.5&quot; - LCD

but i dont.....any ideas

mysql group by not doing what i am expecting?
===

I have this query:

	SELECT
		  bp.product_id,bs.step_number,
		  p.price, pd.name as product_name
		FROM 
		  builder_product bp
		  JOIN builder_step bs ON bp.builder_step_id = bs.builder_step_id
		  JOIN builder b ON bp.builder_id = b.builder_id
		  JOIN product p ON p.product_id = bp.product_id
		  JOIN product_description pd ON p.product_id = pd.product_id
		  WHERE b.builder_id = '74' and bs.optional != '1'
		ORDER by bs.step_number, p.price

which is returning 

		88	1	575.0000	Lenovo Thinkcentre POS PC
		92	1	799.0000	Lenovo Thinkcenter Server - RAID Configured
		31	1	1599.0000	All-In-One - Lenovo Thinkcentre 23&quot;
		63	2	169.0000	Lenovo Thinkvision 18.5&quot; - LCD
		62	2	249.0000	Lenovo Thinkvision 22&quot; - LCD
		244	2	559.0000	Touchscreen with MSR - Firebox 15&quot;
		104	3	285.0000	Remote Order Printer - Epson
		65	3	355.0000	Barcode and Label Printer - Zebra 2&quot; TT
		68	3	399.0000	Barcode And Label Printer - Zebra 4&quot; DT
		254	4	106.0000	Cash Drawer - APG - 14X16 - Black
		251	4	195.0000	Cash Drawer - APG - 16X16 - Serial
		97	4	395.0000	Aldelo Lite
		97	5	395.0000	Aldelo Lite
		121	5	549.0000	Cash Register Express  - Pro
		279	5	849.0000	Aldelo Premium
		135	6	0.0000  	Free!! Payment Processing Software
		191	6	349.0000	Integrated Payment Processing
		231	7	0.0000	  1 User/Location - 8Am - 8Pm Mon - Fri Support Plan - Level 1
		232	7	0.0000	  1 User/Location - 24 X 7 X 365 Support Plan - Level 1
		155	7	369.0000	Accessory - Posiflex 12.1&quot; LCD Customer Display


what i need is the lowest price from each step so i assumed adding the group by would work 


	SELECT
		  bp.product_id,bs.step_number,
		  p.price, pd.name as product_name
		FROM 
		  builder_product bp
		  JOIN builder_step bs ON bp.builder_step_id = bs.builder_step_id
		  JOIN builder b ON bp.builder_id = b.builder_id
		  JOIN product p ON p.product_id = bp.product_id
		  JOIN product_description pd ON p.product_id = pd.product_id
		  WHERE b.builder_id = '74' and bs.optional != '1'
		group by bp.step_number
		ORDER by bs.step_number, p.price

but here is my results

	88	1	575.0000	Lenovo Thinkcentre POS PC
	244	2	559.0000	Touchscreen with MSR - Firebox 15&quot;
	104	3	285.0000	Remote Order Printer - Epson
	97	4	395.0000	Aldelo Lite
	121	5	549.0000	Cash Register Express  - Pro
	191	6	349.0000	Integrated Payment Processing
	155	7	369.0000	Accessory - Posiflex 12.1&quot; LCD Customer Display

as you can see its wrong because on step 2 I should have 

		63	2	169.0000	Lenovo Thinkvision 18.5&quot; - LCD

but i dont.....any ideas
