Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Drawing a pattern in sql

User_LCHKLSep 23 2016 — edited Sep 23 2016

I need to generate following pattern using sql

* * * * *

* * * *

* * *

* *

*

I tried below sql but not able to generate the spaces between stars

SELECT rpad('*',b.a,'*')

FROM

  ( SELECT level a FROM dual CONNECT BY level <= 5 ORDER BY level DESC

  ) b

*****

****

***

**

*

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 21 2016
Added on Sep 23 2016
5 comments
539 views