|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-07-27 01:44 UTC] bestlong168 at gmail dot com
-Summary: run sql query get no result
+Summary: PDO_DBLIB: Run specific sql query
get no result
-Operating System: Ubuntu 20.04.2 LTS
+Operating System: Irrelevant
-PHP Version: 7.4.21
+PHP Version: Irrelevant
[2021-07-27 01:44 UTC] bestlong168 at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 21:00:01 2025 UTC |
Description: ------------ The following SQL query run on MS Query, FreeTSD tsql will get 10 row result, but run dblib query get no result. select row_num = identity(int,1,1), * into #b_resources from ( select * from (select top 20 * from b_resources) A union all select * from b_resources where 1=2 ) B; select * from #b_resources where row_num between 11 and 20; drop table #b_resources; Test script: --------------- $sql = 'select row_num = identity(int,1,1), * into #b_resources from (select * from (select top 20 * from b_resources) A union all select * from b_resources where 1=2 ) B; select * from #b_resources where row_num between 11 and 20;drop table #b_resources;'; $rows = []; foreach($conn->query($sql) as $row) { $rows[] = $row; } dump($rows); Expected result: ---------------- get 10 row result Actual result: -------------- no result