- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
George John has Published 1234 Articles
George John
4K+ Views
To MySQL order string with numbers, the following is the syntax, wherein we have used ORDER BY, SUBSTR() and CAST() −SELECT *FROM yourTableName ORDER BY SUBSTR(yourColumnName FROM 1 FOR 2), CAST(SUBSTR(yourColumnName FROM 2) AS UNSIGNED);To understand the above syntax, let us create a table. The query to create a table ... Read More
George John
2K+ Views
You can use GROUP BY command for select with distinct id. The syntax is as follows −SELECT *FROM yourTableName GROUP BY yourColumnName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table DistinctIdDemo -> ( -> Id ... Read More
George John
4K+ Views
To select distinct combinations from two columns, you can use CASE statement. Let us create a table with some columns.The query to create a table is as follows −mysql> create table select_DistinctTwoColumns -> ( -> Id int NOT NULL AUTO_INCREMENT, -> FirstValue char(1), -> SecondValue char(1), ... Read More
George John
14K+ Views
You can use ORDER BY RIGHT() function to order by last 3 chars in MySQL. The syntax is as follows −SELECT *FROM yourTableName ORDER BY RIGHT(yourColumnName, 3) yourSortingOrder;Just replace the ‘yourSortingOrder’ to ASC or DESC to set the ascending or descending order respectively.To understand the above syntax, let us create ... Read More
George John
4K+ Views
An intent filter is an instance of the IntentFilter class. Intent filters are helpful while using implicit intents, It is not going to handle in java code, we have to set it up in AndroidManifest.xml. Android must know what kind of intent it is launching so intent filters give the ... Read More
George John
4K+ Views
An Iterator can be used to loop through an ArrayList. The method hasNext( ) returns true if there are more elements in ArrayList and false otherwise. The method next( ) returns the next element in the ArrayList and throws the exception NoSuchElementException if there is no next element.A program that ... Read More
George John
2K+ Views
Line break in a UILabel is used to change how the text appears on a label. Suppose a label has text more than two lines but by default the Line break in a UILabel is used to change how the text appears on a label. Suppose a label has text ... Read More
George John
917 Views
An element in ArrayList can be replaced using the ListIterator method set(). This method has a single parameter i.e. the element that is to be replaced and the set() method replaces it with the last element returned by the next() or previous() methods.A program that demonstrates this is given as ... Read More
George John
6K+ Views
The iterator can be used to iterate through the ArrayList wherein the iterator is the implementation of the Iterator interface. Some of the important methods declared by the Iterator interface are hasNext() and next().The hasNext() method returns true if there are more elements in the ArrayList and otherwise returns false. ... Read More
George John
312 Views
Create TreeSet and add elements to itTreeSet tSet = new TreeSet(); tSet.add("P"); tSet.add("Q"); tSet.add("R"); tSet.add("S");Now, let us traverse elements in descending orderIterator j = tSet.descendingIterator(); while(j.hasNext()) { System.out.println(j.next()); }The following is an example to traverse TreeSet elements in descending orderExample Live Demoimport java.util.*; public class Demo { public static ... Read More
To Continue Learning Please Login
Login with Google