Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select a specific index row in sqlite

I have an index and I need to find out what is the row in a table with that index, in SQLite. Example:

Index = 1

Table:

ID   -    Name
aa1      John
aa2      Mark   <-- I need this row
aa3      Lucy
aa4      Jim 

Which is the correct SELECT that I can use to solve my problem?

like image 515
gabboSonc Avatar asked May 07 '14 09:05

gabboSonc


People also ask

How do I SELECT a specific column in SQLite?

SQLite select specific columns We can use the SELECT statement to retrieve specific columns. The column names follow the SELECT word. We retrieve the Name and the Price columns. The column names are separated by commas.


1 Answers

Typically to get a specific row you can always request them by rowid, e.g.

SELECT name FROM UnknownTable WHERE rowid = 1;

However, there are some atypical situations that preclude this. You'll really want to read up on rowids to ensure that your table is going to behave as you want.

like image 189
maha Avatar answered Nov 15 '22 08:11

maha