Hi,

this requires a simple join:

select siterate.name,  sitetype.name
from siterate
join sitetype on sitetype.id = siterate.type
where sitetype.status!=1

This supposes that for every entry in siterate, there exists an entry in 
sitetypes with sitetype.id = siterate.type

It seems to me that you might want to read up on SQL.

Martin

Artur Reilin schrieb:
> I need help with my query.
>
> I have two tables:
>
> sitetypes(
>   id integer primary key not null,
>   name text
> )
>
> siterate(
>   id integer primary key not null,
>   type integer not null,
>   status integer not null,
>   ...
>   ...
> )
>
> This is my currently query:
> $all_waiting_sites = sqlite_array_query('select name,type from
> '.$databasename.'siterate where status!=1 order by name',$db);
>
> And i like that my query, that makes the type integer from siterate into
> the name text from sitetypes.
>
> Thanks forward for helping me.
>
> with best wishes
>
>
> Artur Reilin
> sqlite.yuedream.de
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>   
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to