Union will remove duplicates. Union All does not.
Note:- For union , must have same columns.
example
Union
Select top (select COUNT(*) from CourtApplicationDetails) * From CourtApplicationDetails
union
Select top ((select COUNT(*) from CourtApplicationDetails)-(1)) * From CourtApplicationDetails
===============================
union all
Select top (select COUNT(*) from CourtApplicationDetails) * From CourtApplicationDetails
union all
Select top ((select COUNT(*) from CourtApplicationDetails)-(1)) * From CourtApplicationDetails
No comments:
Post a Comment