Show pageOld revisionsBacklinksExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Get row position in ordered result set (pagination) ====== <code sql> SET @val := 0; CREATE TEMPORARY TABLE IF NOT EXISTS inv_items_tmp AS (SELECT (@val := @val + 1) AS val, id FROM inv_items ORDER BY inv_no,model); SET @oneless := (SELECT val FROM inv_items_tmp WHERE id=2977); SELECT COUNT(*) FROM inv_items_tmp WHERE val<@oneless; DROP TABLE inv_items_tmp; </code> database/mysql/get_item_position_in_resultset.txt Last modified: 2019/10/31 09:04by 127.0.0.1