Click here to Skip to main content
15,880,651 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have mysql table with 16000 records. I'm using mysql with asp.net. this is my query

SQL
CREATE   PROCEDURE `CustomerOrder_SelectItems_ByCompany`(
IN pCompanyId INT)
BEGIN


SELECT 
			 -1 as ItemId 
			,'Select Item' as Description3
            , 'Select No' as No
            , 'Select No2' as No2
			, 0 as RowNo

		UNION			
			SELECT S.ItemId
				, S.Description3
                , S.No
                , S.No2
				, 1 as RowNo  
            FROM itemmaster S 
            where statusId=1 AND S.CompanyId=pCompanyId 
END


this is dropdownbox select query. this take more times to load. I'm using select2 scripts to bind drop down data.
Posted
Updated 24-Jan-16 20:24pm
v3

1 solution

Have you thought about creating a [perhaps read-only] view representing your query ?

MySQL Create View tutorial with examples[^]
 
Share this answer
 
Comments
amnk.info 25-Jan-16 2:21am    
I'm new to mysql. Thanks for reply i will try this

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900