MySQL Alias for Select Columns

Rishi Rathor
Updated on 30-Jul-2019 22:30:24

389 Views

MySQL alias cannot be used with *. However, it can be used for individual column. The syntax is as follows −select anyaliasName.yourColumnName1 as anyaliasName1, anyaliasName.yourColumnName2 as anyaliasName2, anyaliasName.yourColumnName3 as anyaliasName3, anyaliasName.yourColumnName4 as anyaliasName4, . . . . N from yourTableName as anyaliasName;MySQL alias is a variable of table that can be used to access the column name of that particular table. To understand the above syntax, let us create a table.The query to create a table is as follows −mysql> create table TableAliasDemo    −> (    −> Id int,    −> Name varchar(100),    −> Age int    −> ... Read More

Android Image Scale Animation Relative to Center Point

Chandu yadav
Updated on 30-Jul-2019 22:30:24

2K+ Views

This example demonstrate about Android image scale animation relative to center point.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 code, we have taken button to show image scaling animation(Zoom animation).Step 3 − Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.view.animation.Animation; import android.view.animation.ScaleAnimation; import android.view.animation.TranslateAnimation; import android.widget.Button; import android.widget.ImageView; import android.widget.LinearLayout; public class MainActivity extends AppCompatActivity {   ... Read More

FTP Delete Function in PHP

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

166 Views

The ftp_delete() function is used to delete a file on the FTP server.Syntaxftp_delete(con,myfile);Parameterscon − The FTP connectionmyfile − The file to be deletedReturnThe ftp_delete() function returns TRUE on success or FALSE on failureExampleThe following is an example to delete a file −

Remove All Values from TreeMap in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

469 Views

Use the clear() method to remove all values from TreeMap.Let us first create a TreeMap −TreeMap m = new TreeMap();Add some elements to the TreeMap −m.put(1, "PHP"); m.put(2, "jQuery"); m.put(3, "JavaScript"); m.put(4, "Ruby"); m.put(5, "Java"); m.put(6, "AngularJS"); m.put(7, "ExpressJS");Let us now remove all the values −m.clear();The following is an example to remove all values from TreeMap −Example Live Demoimport java.util.*; public class Demo { public static void main(String args[]) { TreeMap m = new TreeMap(); m.put(1, "PHP"); m.put(2, "jQuery"); ... Read More

Is MySQL LIMIT Applied Before or After ORDER BY

Anvi Jain
Updated on 30-Jul-2019 22:30:24

146 Views

The MySQL LIMIT is applied after ORDER BY. Let us check the limit condition. Firstly, we will create a table −mysql> create table LimitAfterOrderBy    −> (    −> Id int,    −> Name varchar(100)    −> ); Query OK, 0 rows affected (0.50 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into LimitAfterOrderBy values(101, 'John'); Query OK, 1 row affected (0.18 sec) mysql> insert into LimitAfterOrderBy values(102, 'Carol'); Query OK, 1 row affected (0.15 sec) mysql> insert into LimitAfterOrderBy values(103, 'Bob'); Query OK, 1 row affected (0.21 sec) ... Read More

What is the Prelude All About

Ridhi Arora
Updated on 30-Jul-2019 22:30:24

960 Views

The Prelude is a long poem by William Wordsworth compiled into fourteen books. All these books trace his spiritual growth with the subtitle of the poem itself as its the theme, which is the growth of the poet's mind.Justification of the TitleThe title stands justified as Wordsworth describes how Nature began its mysterious work in his conscious and subconscious mind. He is convinced that there are hidden forces in Nature impacting him inadvertently right from the time he was a young boy and he thus, recounts a few incidents and comments upon their significance in shaping up his mind. The ... Read More

Change File Attribute to Read-Only in Java

Samual Sam
Updated on 30-Jul-2019 22:30:24

864 Views

A file attribute can be changed to read-only by using the method java.io.File.setReadOnly(). This method requires no parameters and it returns true if the file is set to read-only and false otherwise. The method java.io.File.canWrite() is used to check whether the file can be written to in Java and if not, then the file is confirmed to be read-only.A program that demonstrates this is given as follows −Example Live Demoimport java.io.File; public class Demo {    public static void main(String[] args) {       boolean flag;       try {          File file = new File("demo1.txt"); ... Read More

Format to 2 Decimal Places in a 10 Character Field in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

188 Views

To format, use the Formatter class. Import the following package to work with the Formatter class in Java −import java.util.Formatter;Create a Formatter object and format to 2 decimal places in a 10-character field −Formatter f = new Formatter(); System.out.println(f.format("%10.2e", 3989.7886));The following is the complete example −Example Live Demoimport java.util.Formatter; public class Demo { public static void main(String args[]) { Formatter f = new Formatter(); System.out.println(f.format("%08d", 697)); f = new Formatter(); System.out.println(f.format("%03d", 9878)); f = new Formatter(); System.out.println(f.format("%10.2e", 3989.7886)); } }Output00000697 9878 3.99e+03

Insert the Results of a MySQL SELECT Query

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:24

186 Views

You do not need to use values whenever you insert the results of a select. To insert the results of select, let us first create two tables.The first table query is as follows −< FirstTableDemo> mysql> create table FirstTableDemo    −> (    −> StudentId int,    −> StudentName varchar(100)    −> ); Query OK, 0 rows affected (0.41 sec)Now create second table and after that insert the second table records in the first table using INSERT SELECT command.The query to create the second table − mysql> create table SecondTableDemo    −> (    −> Id int,    −> ... Read More

Show and Hide View with Slide Up Down Animation in Android

Arjun Thakur
Updated on 30-Jul-2019 22:30:24

2K+ Views

This example demonstrate about how to Show and hide a View with a slide up/down animation 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 code, we have taken button to show /hide linear layout with animation.Step 3 − Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.view.animation.TranslateAnimation; import ... Read More

Advertisements