I discovered today when writing a stored procedure for a web reporting application that MySQL doesn’t support using variables for the LIMIT clause in a SELECT statement. I didn’t really want to write a dynamic query, one workaround that I found while Googling looked promising:
SET SQL_SELECT_LIMIT = RowLimit (can be a variable)
SELECT ….
SET SQL_SELECT_LIMIT = default
However it is applied at a global level and I needed different limits within a sequence of four queries formed into a union to get the top N results for a series of categories. Because I was giving the user the limited choice of retrieving the top 10, 20, 50 or 100 items I ending up using a CASE statement with each WHEN clause containing a duplicate of the entire query. Certainly not a pretty solution but works and is reasonably maintainable by leaving the LIMIT clause on a seperate line so any changes can be cut & pased down the procedure.
Pillspot.org. Canadian Health&Care.No prescription online pharmacy.Special Internet Prices.PillSpot.org. Herbal-supplements@buy.online” rel=”nofollow”>.…
Categories: Mens Health.Eye Care.Weight Loss.Antidepressants.Antidiabetic.Anti-allergic/Asthma.Stop SmokingMental HealthSkin Care.Pain Relief.Womens Health.Stomach.Anxiety/Sleep Aid.Antiviral.Antibiotics.Blood Pressure/Heart.Vitamins/Herbal Supple…
Buy:Actos.Accutane.Mega Hoodia.Zovirax.Lumigan.Human Growth Hormone.Synthroid.Nexium.Retin-A.Valtrex.Petcam (Metacam) Oral Suspension.Zyban.100% Pure Okinawan Coral Calcium.Prednisolone.Prevacid.Arimidex….
00p Reviews masterbilt epiphone/ http://AUTOPARTSVILLE.INFO/tag/Dr. 5 : 5…
5…
Vacuum http://zrollkbl.BESTPARTSPLUS.INFO/tag/big+cup+whirlwind+Vacuum/ : big…
Vacuum…
home http://sbabyhavqa8e.ALLSTOCKSPORT.INFO/tag/home+depot+18+dishwasher/ : depot…
18…
Furniture http://wmillerohia.ALLSTOCKSPORT.INFO/tag/Teflon+Furniture+sliders/ : Teflon…
Teflon…