In the previous article we’ve seen how we can be able to implement cange Ivo issuing this statement. We’ve also seen examples using kids when as well as I say in this article we’re going to continue our discussion by looking at filtering in duplicate and a select statement. Let’s see one example here.
When you are working at least you might have to create some reports that is not going to contain any duplicate file use we’re acquiring these Montane table for example you can see a mounted and Rocky’s duplicate that more than 10 times a year. The simplest way for us to filter out this duplicate is using a keyword called District files.
The same query that has this thing. Now you can see that Rocky Mount is only going to appear once. Another way to do it is using a pie so we can get rid of it distinct. But if you use the same columns that we use in the select statement in the group why close that is going to give us the same thing or use as well.
How to use a basic ORDER BY clause?
It the previous movies we’ve discussed about select statement in a sequence of which we’ve seen a basic select statement the sequel. We discuss how we can be able to manage plate number treeing and deathly Trotz. We’ve also discussed how we can be able to carry columns from a table how we can be able to perform some condition.
I’ve always been using this way in as well as functions how we can be able to perform some mathematical operations as well as how we can be able to use some building function inside a select state.
In this article we’ll discuss about order by a cause. Another important state and one in sequent language. Let’s assume we’re working as and at least we were tasked to create a report that is going to follow some sort of an order and to be able to produce these. We’re going to have to implement an ORDER BY clause. There are two kinds of order. There is ascending order.
Then we have to use a s c then b a descending order or D s c a d forth ordering. If we don’t specify an ascending order then if I execute this statement you will see that the state I said is order. Yes and the order population. ORDER BY clause we can also be able to sort using two or more columns for example.
We will like to order Montaigne’s by name then by their elevation in a descending order if I execute this statement you will see that this data is sorted by name first and then by elevation.For example if we look at Rocky Mountains you’ll see that the top peak of the mountain or Moland elbow comes first then the second topic of Montaigne’s which is peaks Pike comes back to the status it is or it is Montaigne’s in ascending form and then with elevation in the informant.
So you can keep adding more columns as you wish for an order by clause. Another way to do an ordering is you can be able to refinance the column order Montaigne’s. The second call on the select statements so this. What this means is use mandis for your first ordering in an ascending format and use elevation on the third column.
This is not recommended practice in production but when you are doing any testing you can quickly type the number to be able to sort but another developer columns here then your orders will not be the same. If you’re using an order number instead of a column name or order by.