Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Databases > Re: Selecting r...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 3656 of 3800
Post > Topic >>

Re: Selecting row from a table

by Sabine Dinis Blochberger <no.spam@[EMAIL PROTECTED] > Feb 20, 2008 at 09:23 AM

m wrote:

> 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

Someone once mentioned a query like this:

select 1 from table where col=val

Or, if that doesn't work, do a 

select count(*) from table where col=val

which gives you the number of rows with the condition.
-- 
Sabine Dinis Blochberger

Op3racional
www.op3racional.eu
 




 4 Posts in Topic:
Selecting row from a table
m <modhak@[EMAIL PROTE  2008-02-19 22:46:45 
Re: Selecting row from a table
Sabine Dinis Blochberger   2008-02-20 09:23:55 
Re: Selecting row from a table
GArlington <garlington  2008-02-20 04:05:11 
Re: Selecting row from a table
Elmar Athmer <elmar@[E  2008-02-20 15:40:08 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 4:47:37 CDT 2008.