a doubt in sql please help me

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vinoth888
    New Member
    • Feb 2008
    • 2

    a doubt in sql please help me

    IN sql a select statement should display stars as given below

    *
    **
    ***
    ****

    the stars should be displayed in the form of a triangle

    please give a solution for this..
    Last edited by debasisdas; Feb 27 '08, 03:32 AM. Reason: mailid removed
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Kindly post what you have tried so far .

    Comment

    • vinoth888
      New Member
      • Feb 2008
      • 2

      #3
      a sql query that should display * in the form of a triangle for a table

      ans :
      [code=oracle]

      select lpad('*',rownum ,'*') from table_name where rownum<=6

      [/code]
      Last edited by amitpatel66; Mar 5 '08, 05:15 AM. Reason: code tags

      Comment

      • amitpatel66
        Recognized Expert Top Contributor
        • Mar 2007
        • 2358

        #4
        Your query seems to be fine. It should be working. Any issues in executing that query?

        Comment

        Working...