...">All geek questions in one placeHow can I get a specific row in a query variable using ColdFusion?Take the following query example:<cfquery name="Test" Datasource = "TestDB"> Select * from Table_Test </cfquery> Suppose the query "Test" returns 10 rows. I want to show one line at a time.Note. I do not want to modify the SQL statement.+5coldfusion cfqueryMR Kesavan Oct 27 '14 at 11:49source share2 answersIf you need one random line from the query: <cfset start = randRange(1, Test.recordCount)> <cfoutput> #Test.name[start]# #Test.email[start]#<br> </cfoutput> No need for a loop.NOTE. More efficient query modification to get a random string.How to query random string in SQL?+3Scott jibben Oct 27 '14 at 21:05source shareIf you know your row number, Test.columnName[RowNumber] will show you the columnName value in the specified row number.+6CFML_Developer Oct 27 '14 at 12:18source shareSource: https://habr.com/ru/post/1205603/More articles:R: Error in fBody [[i]] when starting debugSource - debuggingHiding a column in jQuery dataTables - jquery-datatablesPython dict lock? - pythonvolume button when locking Android phone - androidlink to boost with visual studio 2013 - c ++Calculating row average - dateManually verify SSL certificate in WebView - androidNetbeans ant build error 'unsupported customize element' - javaScrolling events in AngularJS - javascriptOnDateChanged method not working - androidAll Articles
Take the following query example:
<cfquery name="Test" Datasource = "TestDB"> Select * from Table_Test </cfquery>
Suppose the query "Test" returns 10 rows. I want to show one line at a time.
Note. I do not want to modify the SQL statement.
If you need one random line from the query:
<cfset start = randRange(1, Test.recordCount)> <cfoutput> #Test.name[start]# #Test.email[start]#<br> </cfoutput>
No need for a loop.
NOTE. More efficient query modification to get a random string.
How to query random string in SQL?
If you know your row number, Test.columnName[RowNumber] will show you the columnName value in the specified row number.
Test.columnName[RowNumber]
Source: https://habr.com/ru/post/1205603/More articles:R: Error in fBody [[i]] when starting debugSource - debuggingHiding a column in jQuery dataTables - jquery-datatablesPython dict lock? - pythonvolume button when locking Android phone - androidlink to boost with visual studio 2013 - c ++Calculating row average - dateManually verify SSL certificate in WebView - androidNetbeans ant build error 'unsupported customize element' - javaScrolling events in AngularJS - javascriptOnDateChanged method not working - androidAll Articles