Jump to content

Recommended Posts

Posted

Hello Everyone,

 

Seasons Greetings....

 

Right i've got a SQL query which would should return the same row but multipule times, however i only get the row returned once.

 

How should I go about this?

 

Thanks

 

.Adam

Posted
Do you mean you think that the query you've constructed should return multiple rows as it is; or do you want to know how to make it return multiple rows? Either way, posting the query you have will help in responding :)
Posted (edited)

SELECT SUM(`cost`)
			FROM `costs`
			WHERE `id` in (
				SELECT `cost_id`
				FROM `events`
				WHERE `printer_id` = $printer_id
			)

 

webman should reconise the code (since its been added to his printmaster system :p )

 

i've attached the full zip file with the database printmastertest.zip

 

This should return the same row multipule times so I can sum up the cost from each row.

Edited by fawkers

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...