thecr0w
thecr0w

Reputation: 2197

Sqlite: select same colume from many tabls

Let's say we have tables: t1(_id, url), t2(_id ,url), t3(_id, url), ...

I wanna get all url from tables:

select url from t1 union select url from t2 union select url from t3 union ...

It's fine, but too long if I have 3 more tables. So how can I get all url in all table?

Upvotes: 0

Views: 87

Answers (1)

user647772
user647772

Reputation:

If you need data from all tables, you must name all tables somewhere in the FROM clause. SQLite has no way of knowing wich tables you want to SELECT from if you don't name them.

Upvotes: 1

Related Questions