i want to display 1 to 10 numbers using one select statement.
Answers were Sorted based on User's Feedback
Answer / mkumar.it
select rownum from user_objects where rownum <= 10
| Is This Answer Correct ? | 71 Yes | 20 No |
Answer / pramod kumar behera
select rownum from dual connect by level <=10;
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / pramod kumar behera
select level from dual connect by level <=10;
| Is This Answer Correct ? | 7 Yes | 1 No |
Answer / srikanth
select rownum from user_objects where rownum <= 10 order by
rownum ASC
| Is This Answer Correct ? | 12 Yes | 9 No |
Answer / kriti sinha
For in 10 rows in a single column
select level from dual connect by level<=10
for 10 numbers in a single column
select 1||chr(10)||2||chr(10)||3||chr(10)||4||chr(10)
||5||chr(10)||6||chr(10)||7||chr(10)||8||chr(10)||9||chr(10)
||10 from dual;
For 10 rows in 10 columns
select 1,2,3,4,5,6,7,8,9,10 from dual;
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / nagesh
SELECT * FROM EMP WHERE ROWNUM<=10 ORDER BY ENO;
| Is This Answer Correct ? | 6 Yes | 3 No |
Answer / srinivas
select rownum rn from (select 1 from dual group by
cube(1,2,3,4,5)) where rownum <=10
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sumit
declare
abc varchar2(500) ;
begin
select 1||chr(0)||2||chr(0)||3 ..... into
abc from dual;
dbms_output.put_line(abc);
end;
cannot use chr(10) to take columns in sql.
way is to use rownum,row_number or any psuedo column like
sequence
| Is This Answer Correct ? | 1 Yes | 0 No |
What is gpt format?
What is auto increment?
What are the different ways to optimize a sql query?
What is the difference between a database and a relational database?
Should I use mbr or gpt?
i have xml source. xml source having lacks of records. i want extract/retrive xml source data using sql query. please tell me how to write query.
I have 2 table A and B. In A 1 lakh record is present. In b 20 thousand data is present. To get the unique data from table A and B which join we should prefer left inner join or right outer join. Please answer.
How many commands are in sql?
What is a Mapplet?
Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql
what is the difference difference between procedure and packages
2 Answers 3i Infotech, Oracle,
What is sp_helptext?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)