I have to return more than one value for a select statement ...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • spooky
    New Member
    • Oct 2006
    • 27

    I have to return more than one value for a select statement ...

    Hi,

    I have a stored procedure with a select statement in it ... my problem is i have a account number which has more than one entry in the table how do i do it in stored procedure....

    ie the person can take more than one loan so that account number will have two entries in my table.. how do i do this using stored procedure
  • pradeep kaltari
    Recognized Expert New Member
    • May 2007
    • 102

    #2
    Hi,
    If the same account number is repeating then you can use:
    1. MAX(account_num ber) in the SELECT clause. As you might know this will result in 1 row.
    2. You can also use LIMIT clause.
    E.g.:
    [code=mysql]
    Select account_number
    From <Table>
    LIMIT 1
    [/code]
    Even this will result in 1 row

    Please let me know if this is what you were looking for.

    ~Pradeep


    Originally posted by spooky
    Hi,

    I have a stored procedure with a select statement in it ... my problem is i have a account number which has more than one entry in the table how do i do it in stored procedure....

    ie the person can take more than one loan so that account number will have two entries in my table.. how do i do this using stored procedure

    Comment

    • spooky
      New Member
      • Oct 2006
      • 27

      #3
      Hi,
      Thank you for replying ... I want to get all the values not just one how do I do it..

      Regards
      Anil

      Comment

      • amitpatel66
        Recognized Expert Top Contributor
        • Mar 2007
        • 2358

        #4
        Originally posted by spooky
        Hi,
        Thank you for replying ... I want to get all the values not just one how do I do it..

        Regards
        Anil
        Do you want to return the records from a procedure or you want to display it with in the procedure?

        Comment

        Working...