[ACCEPTED]-how do I make a select which always returns zero rows-jdbc

Accepted answer
Score: 30
SELECT * FROM tableName WHERE 'You' = 'Smart'

0

Score: 17

...or you could just use the DatabaseMetaData 2 route.

There's a "getColumns" method that 1 does what you need without creating a resultset.

Score: 9

SELECT * FROM table_name WHERE 1 = 2;

0

Score: 5
select * from tablename where 1 != 1

0

Score: 3

Unrelated, but if you just need the columns 2 in MySQL, you can run SHOW FIELDS FROM tablename. This 1 returns columns and the associated info.

More Related questions