I am trying to write an sqlite select statement that performs the below
pseudo code, but am getting nowhere. Any help we be very appreciated.
PSEUDO CODE
for each element1 in (select address.* from numbers,address where
numbers.number = "12345678" and numbers.address_id = address.address_id)
{
for each element2 in (select numbers.* from numbers where address_id =
element1.address_id LIMIT 20)
return element1.* , elemen2.number
}
That is.... given....
table "address" contains
address_id , name
------------------------------
1 , Peter
2 , Paul
3 , Mary
4 , Bob
and table "numbers" contains
address_id , number
---------------------------------
1 , 12345678
2 , 12345678
1 , 09876654
4 , 87876765
the output would be
1 Peter 12345678
1 Peter 09876654
2 Paul 12345678
Thanks in advance
Andrew
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users