Hi,
        I have problem with join and order clause.  I have 2 table join with 
amount condition and sort by order clause.  The result of this join 
generate unwanted row to me.

        example
        table1
        No.     Amount          Count
        1       1000              2             
        2       2000              3
        3        500              1
        table2
        No.     Name            Amount
        1       A               1000
        2       B               2000
        3       C               2000
        4       D               1000
        5       E                500
        6       F               2000

        sql=select * from table1,table2 where table1.amount=table2.amount order by 
table2.amount desc,table2.no

        result table
        no      name            amount          count
        2       B               2000            3
        2       B               2000            3
        3       C               2000            3
        3       C               2000            3
        6       C               2000            3
        6       C               2000            3
        1       A               1000            2
        1       A               1000            2
        4       D               1000            2
        4       D               1000            2
        5       E                500            1
        5       E                500            1
        
        If I did not use order by table2.no in sql it generate result correctly.

SF
        


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to