You're telling us very little about your environment. What database are you using? How do you call your sp? Can you post an excerpt of your caller code?
In the second SP code you posted an END seems to be missing. Is it just a typo?
yes they work without a group by withount being in a stored proc ill try the group by in the stored. I tried distinct but it didnt work. An as far as the flight id changinging cause i have many flight ids i need to know the total that they brought in.Based on a given flight id. so my outtput shoud be the given flith id an its total Revenue brought in. But when i put it in a stored proc i get null in both columns.
posted 2 years ago
Quick read of the docs, and it does appear that MySQL treats an aggregation function without a GROUP BY as grouping by all columns in the result.
Learn something new everyday!
Still not sure why Flight is in the FROM clause, though.
Does the result from the stored procedure work correctly if you hard code a flight number in it?
Hey guys thanks for all the help and advice.But my error was me when I was executing the stored procedure in php admin I was making a boo boo. I was putting my flight ID in As 'GH334' instead of GH334 which was why it was giving me a null but I did add the Group by to make it look better.Again thanks a lot