C # How to query Rownum in Mysql. For more information, see
C # How to query Rownum in Mysql. For more information, see
SQL:
The Code is as follows:
SELECT
@ Rownum: = @ rownum + 1 AS rownum,
A. order_id,
Case when a. Ordered = 1 then 'split into tickets 'end as Ordered,
A. printed,
A. order_sn,
A. user_id,
B. user_name,
A. consignee,
A. tel,
A. mobile,
A. address,
A. pay_name,
A. goods_amount,
A. shipping_ing,
FROM_UNIXTIME (a. add_time + 8*3600 ),
A. postscript,
A. best_time
FROM (SELECT @ rownum: = 0) r, xj_order_info a inner join xj_users B on a. user_id = B. user_id
Where (order_status = '1') and (FROM_UNIXTIME (a. add_time) between' {0} 'and' {1 }')
Order by rownum asc
There is no problem with querying SQL statements in Navicat, but various errors are reported in the program.
I tried changing @ ?, You have also tried the parameter passing method, but none of them are successful.
Finally, the solution is found in StackOverflow:
Allow User Variables = True;
The problem is solved successfully.