OT Intrebare de MySQL

Christian Eichert moga at mx.homelinux.org
Wed Jan 11 11:23:35 GMT 2006


Am doua Tabele

Tabela1
| nr	| Numele	| Accept
| 1	| Ion		| da
| 2	| gheorge 	| nu
| 3	| mihai		| nu
| 4	| petrica	| nu
| 5	| nicolae	| da
etc

Tabela2
| Nume	| Adresa
|-------|-------
|Ion	| ....
|Susi	| .....
|Mihai	| .....
|stoian	| ...
|anna	| ...
|petre	| ...
etc

vreau sa selectez adresele la toti cei din tabela 2 care au dat accept.

E bine asha:

SELECT DISTICT Tabela1.Adresa
	FROM Tabela1
	WHERE Tabela1.Numele=Tabela2.Nume
	AND Tabela1.Accept="da"

ce parere aveti?



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.ubuntu.com/archives/ubuntu-ro/attachments/20060111/81e6dba6/signature.pgp


More information about the ubuntu-ro mailing list