Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Select 1

 
Akhilesh Trivedi
Ranch Hand
Posts: 1603
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does



do? What is its use ?
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This query creates a cursor which contains one column and as many rows as there are in the table. Value of that column is 1 in all rows.

This is not very useful construct.

I sometimes do use constants in the select clause in more complicated circumstances, eg:

(Note: the order by 2, 3 causes ordering by second and third column of the resultset. It is useful with union operator as there could be ambiguity in column names otherwise.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic