Selecting row from a table



Hi All

I have a table with nearly 10,000 rows and 50 columns.

I have a select query like
select * from tablex where col1=5 and col2='a'

I run this from my java program using jdbc.
All I am interested is if there is match or not.

Is there a better way to write the query instead of saying "select *"
I am thinking select * might take more time.

Please let me know.

Thanks
.



Relevant Pages

  • Re: sp_spaceused reporting anomolies?
    ... when I ran the 'select * from TableX' ... query, it took ~ 5 seconds for the query to execute. ... so I'm wondering if there is some database corruption ...
    (microsoft.public.sqlserver.server)
  • Re: Qry not pulling bound column problem
    ... What are TableX and TableY? ... The UNION query will show ALL records in TableX and ALL records in TableY, ...
    (microsoft.public.access.queries)
  • Re: Upgrading from 9.21 to 10 planning
    ... SELECT tableX.* FROM tableX WHERE tableX.att1=? ... If you run the query a few times IDS crashes with following trace from af ... Statement caching is having a problem with what you are doing." ...
    (comp.databases.informix)
  • Re: Starting Date of Week(Week Number Issue)
    ... from tablex s INNER JOIN tabley b on group by DAtenameorder ... by avg desc ... this is the query i had....which i formed with great difficulty, ...
    (microsoft.public.sqlserver.programming)
  • Re: query enhancement
    ... The query, as it now stands, tests for the presence of 'null' in one ... select countfrom tableX where columnX IS NULL; ... Presuming you have an index this may produce an index fast full scan ...
    (comp.databases.oracle.server)