Potansiyel alıcılar tarafından görüntülenmeyen en fazla mülke sahip bir mülk sahibi seçmem gerekiyor.maksimum boş değer seçin
'propertyno IS NULL' sayısının en yüksek olduğu 'propertyforrent.ownerno' öğesini seçmenin en iyi yolu nedir?
BU:
SELECT PropertyForRent.ownerno
FROM PropertyForRent propertyforrent, Client client, Viewing viewing
WHERE client.preftype=propertyforrent.type
AND client.clientno=viewing.clientno
AND viewing.propertyno IS NULL
ORDER BY count(*)
LIMIT 1
VEYA BU:
SELECT PropertyForRent.ownerno
FROM PropertyForRent propertyforrent, Client client, Viewing viewing
WHERE client.preftype=propertyforrent.type
AND client.clientno=viewing.clientno
AND MAX(COUNT(viewing.propertyno IS NULL)
TEŞEKKÜRLER !!
Lütfen değil SQL endişe değiliz PropertyforRent.PropertyNo için FK olduğu 'NULL' özel muamele vardır. 'NULL' ** başka bir' NULL' dahil olmak üzere herhangi bir değere eşit değil **. Sorgularınızda 'IS NULL' kullanmanız gerekiyor. –
Anlamı '=' NULL '' yerine '' NULL '' demeliyim doğru mu? – am340
Evet. Anladın. BTW, ayrıca 'NULL DEĞİL' de var. –