SQLite Forum

Select by column id
Login
You can *always* refer to the ROWID of a ROWID Table using the names `ROWID` or `_rowid_` unless those names have been otherwise declared to not be the rowid, whether or not the rowid (integer primary key) as been given another name.

For example, in the following:

```
create table x
(
  x integer primary key,
  w integer
);
```

The queries return exactly the same result (save the column name):

```
select * from x;
select x, w from x;
select rowid, w from x;
select _rowid_, w from x;
select * from x where x == _rowid_;
select * from x where x == rowid;
select * from x where rowid == _rowid_;
```