Chandu yadav has Published 1163 Articles

How to get the second last record from a table in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

4K+ Views

To get the record before the last one i.e. the second last record in MySQL, you need to use subquery.The syntax is as followsSELECT *FROM (SELECT *FROM yourTableName ORDER BY yourIdColumnName DESC LIMIT 2) anyAliasName ORDER BY yourIdColumnName LIMIT 1;Let us first create a table. The query to create a ... Read More

DoubleStream mapToInt() method in Java

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

104 Views

The mapToInt() function of the DoubleStream class returns an IntStream consisting of the results of applying the given function to the elements of this stream.The syntax is as followsIntStream mapToInt(DoubleToIntFunction mapper)Here, mapper is a stateless function to apply to each element. The DoubleToIntFunction is a function that accepts a double-valued ... Read More

Memory speed requirement in 8085 Microprocessor

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

204 Views

At the end of the state T2 in a machine cycle, 8085 processor senses the Ready input pin. If it is logic 0, 8085 processors enter the Twait state, else it enters to the T3 state. The Ready input is permanently fixed to logic 1. The memory chips and the Input ... Read More

How android YouTube app Play Video from Intent

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

2K+ Views

In some situations, we should open you tube application from our application to show some specific video. This example demonstrate about How android YouTube app Play Video from Intent.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to ... Read More

How to add elements in Java CopyOnWriteArrayList?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

109 Views

To add elements in CopyOnWriteArrayList class in Java, use the add() method. Here, the element is appended to the end of the list.The syntax is as followsboolean add(E e)Here, the parameter e is the element to be appended to this list.To work with CopyOnWriteArrayList class, you need to import the ... Read More

C++ Program to Implement Ternary Tree

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

414 Views

A ternary tree, is a tree data structure in which each node has at most three child nodes, usually represented as “left”, “mid” and “right”. In this tree, nodes with children are parent nodes, and child nodes may contain references to their parents. This is a C++ Program to Implement ... Read More

DoubleStream flatMap() method in Java

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

84 Views

The flatMap() method of the DoubleStream class returns a stream with the results of replacing each element of this stream with the contents of a mapped stream formed by applying the provided mapping function to each element.The syntax is as followsDoubleStream flatMap(DoubleFunction

What MySQL databases do I have permissions on?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

74 Views

To check this, you can use SHOW command. The syntax is as follows −show grants\GLet us implement the above syntax to display the permissions you have −mysql> SHOW GRANTS\GThis will produce the following output −*************************** 1. row *************************** Grants for root@%: GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, ... Read More

How to make custom dialog in android?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

5K+ Views

This example demonstrate about how to make custom dialog in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     In the above ... Read More

Can we select row by DATEPART() in MySQL? Is it possible?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

2K+ Views

There is no DATEPART() function in MySQL, you need to use MONTH() function to extract the month name from date column. The syntax is as follows:SELECT *FROM yourTableName WHERE MONTH(yourDateColumnName)=yourValue;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table ... Read More

Advertisements