Ummm,
maybe u guys can use what I use?
I use a store procedure as a trick of limit functionality in mysql. When I need a limit function then I called this stored procedure...
Here is my sp:
CREATE PROCEDURE CCFBetaLimitSelectForReportbyQA
(
@query NVARCHAR(2000), -- SQL Query
@ INT, -- page number
@ INT -- limit the result set of the query
)
AS
-- We don't want to return the # of rows inserted
-- into our temporary table, so turn NOCOUNT ON
SET NOCOUNT ON
-- Find out where we will start our records from
DECLARE @RecCount int
SELECT @RecCount = @ * @ + 1
--Create a temporary table
CREATE TABLE #TempReportbyQA
(
ID int IDENTITY,
ccf_id numeric,
ccf_no_old nvarchar(10),
ccf_subject nvarchar(150),
ccf_status nvarchar(4)
)
-- Insert the rows from Query into the temp. table
INSERT INTO #TempReportbyQA (ccf_id, ccf_no_old, ccf_subject, ccf_status)
EXECUTE(@query)
-- Find out the first and last record we want
DECLARE @FirstRec int, @LastRec int
SELECT @FirstRec = (@ - 1) @
SELECT @LastRec = (@ @ + 1)
-- Now, return the set of paged records, plus, an indiciation of we
-- have more records or not!
SELECT ,
MoreRecords =
(
SELECT COUNT()
FROM #TempReportbyQA TRQA
WHERE TRQA.ID > @LastRec
)
FROM #TempReportbyQA
WHERE ID > @FirstRec AND ID < @LastRec
-- Turn NOCOUNT back OFF
SET NOCOUNT OFF
Then anytime I need this sp, I just called it from my page by setting the starting point and limiting the result...
I guess that what I can share...
Thanks