SQL Select?

SELECT * FROM table WHERE FIELD_ONE = '1' AND FIELD_ONE = '1'

I need this to print out 2 rows even though they are the same, it currently only prints one. how would you do this?

4 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    SELECT * FROM table WHERE FIELD_ONE = '1'

    UNION ALL

    SELECT * FROM table WHERE FIELD_ONE = '1'

    This will select the row twice in the same result set

  • Anonymous
    1 decade ago

    The two parts of the AND are redundant...

    SELECT *

    FROM table

    WHERE FIELD_ONE = '1'

    FETCH FIRST 2 ROWS ONLY;

    Or just open a cursor in your application and FETCH twice before closing the cursor.

  • 1 decade ago

    Select Field_one,Filed_one from Table

    Exapmple.

    Table=ABc

    Field=Test

    Select test,test from ABC

  • 1 decade ago

    SELECT table.* FROM table,

    (SELECT 1 AS n

    UNION ALL

    SELECT 2) x

    WHERE FIELD_ONE = '1'

Still have questions? Get your answers by asking now.