Jump to content
Sign in to follow this  
autoitxp

sqlite select first row available

Recommended Posts

autoitxp

Hi which sqlite query is use to get first availble row

like im using

SELECT * FROM  mytable where ID = 1;
but in this query u have to tell id to pick row

how i can get first availble row ?

help !!!

Share this post


Link to post
Share on other sites
Impulse08

Hi which sqlite query is use to get first availble row

like im using

SELECT * FROM  mytable where ID = 1;
but in this query u have to tell id to pick row

how i can get first availble row ?

help !!!

Why don't you do SELECT TOP 1 * FROM mytable where ID = 1;?

Or just drop the WHERE altogether if that's what you're looking for. Hope this helps.


-- If the apocalypse comes... beep me.

Share this post


Link to post
Share on other sites
autoitxp

well ya i want to pick 1 row without puting id =1 this is my primary key how can i get 1 row without using where clause

Share this post


Link to post
Share on other sites
autoitxp

well this not works for me where im doing mistake ?

SELECT TOP 1 * FROM MYTABLE ;

Share this post


Link to post
Share on other sites
Impulse08

well this not works for me where im doing mistake ?

What error are you getting?

SELECT TOP 1 * FROM MYTABLE;

Should be the appropriate query to return only one row.


-- If the apocalypse comes... beep me.

Share this post


Link to post
Share on other sites
Xandl

Hello,

does "select * from mytable limit 1;" work as expected?

Share this post


Link to post
Share on other sites
autoitxp

ya i know this query but when i put limit 2 it start showing up 2 rows not only second row

thats is problem for me i hope u got it

SELECT TOP 1 * FROM MYTABLE;
this is not for sqlite i think Edited by autoitxp

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×