Been a while since using SQL of any type and I can't seem to remember how to
do a particular select.

At present, using something like this...

SELECT peers.compact, torrents.seeds, torrents.peers FROM torrents, peers
WHERE torrents.info_hash='517a5ae2e1d79ad252f4c126e4ea30d9c6e51c17'
AND peers.info_hash=torrents.info_hash
LIMIT 50;

which gives something like this

peers.compact | torrents.seeds | torrents.peers
-----------------------------------------------
data          | 1234           | 1234
data          | 1234           | 1234
data          | 1234           | 1234
data          | 1234           | 1234
data          | 1234           | 1234
etc...

however, i'm getting torrents.seeds, torrents.peers with every row returned
which is redundant (possibly inefficient?)..
i only want the torrents.seeds, torrents.peers once.. the peers.compact can
be returned as usual like so

peers.compact | torrents.seeds | torrents.peers
-----------------------------------------------
data          | 1234         | 1234
data          | null           | null
data          | null           | null
data          | null           | null
data          | null           | null
etc...

Anyone have any ideas? this would be appreciated.
btw, if this query could be optimized even further, i would welcome that.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to