-2

SQLite データベースに、それらの間に関係のない 3 つのテーブルがあります。

次のような条件がある 3 つのテーブルの 1 つに関するすべてのフィールドを返す必要があります。

(table1.field1="something" and table1.field2="something") OR (table2.filed1="something" and table2.field2="something") ...

したがって、どのテーブルに「何か」のフィールドがあるかを知り、そのテーブルの他のフィールドにその情報を返したいと思います。

質問がまったく明確でない場合は、問題の画像を作成しようとします。

編集:

私はこのようなことを試しました:

SELECT idpontosturisticos,idrestauracao,idalojamento from Alojamento,pontosturisticos ,restauracao WHERE (alojamento.latitude=41.158764 AND alojamento.longitude=-7.784906 AND alojamento.nome='Restaurante1') OR (pontosturisticos.latitude=41.158764 AND pontosturisticos.longitude=-7.784906 AND pontosturisticos.nome='Restaurante1') OR (restauracao.latitude=41.158764 AND restauracao.longitude=-7.784906 AND restauracao.nome='Restaurante1')
4

1 に答える 1