Welcome to My Blog 👋

Java, Spring Framework, Microservices, Docker, Kubernetes, AWS and Others 🚀
Follow Me

SQL - Sorgularda Unique, Not Unique Kullanımı



  August 30, 2018    Labels:,,,,,,,,,, 

Unique
  • Unique fonksiyonu parametre olarak içerisine aldığı subqueryden dönen kayıt tek bir satır içeriyorsa yani benzersiz ise TRUE değil ise FALSE döndürür.
Örnek:
  • select * from Musteri m Where unique(select siparisID from Siparis s where s.MusteriID = m.MusteriID) --> Tek bir siparişi olan müşterileri bulan sorgu

Not Unique
  • Not Unique fonksiyonu parametre olarak içerisine aldığı subqueryden dönen kayıt birden çok bir satır içeriyorsa ise TRUE değil ise FALSE döndürür.
Örnek:
  • select * from Musteri m Where not unique(select siparisID from Siparis s where s.MusteriID = m.MusteriID) --> Birden çok siparişi olan müşterileri bulan sorgu

No comments:

Post a Comment