Rama Giri has Published 107 Articles

Match any single character outside the given set.

Rama Giri

Rama Giri

Updated on 20-Jan-2020 10:59:37

112 Views

To match any single character outside the given set with JavaScript RegExp, use the [^aeiou] metacharacter.Example           JavaScript Regular Expression                        var myStr = "Welcome!";          var reg = /[^lc]/g;          var match = myStr.match(reg);                   document.write(match);          

Getting details when a table is modified in SAP HANA DB

Rama Giri

Rama Giri

Updated on 05-Dec-2019 07:45:45

2K+ Views

You can query SYS.M_TABLE_STATISTICS providing name of table and LAST MODIFY DATE. Here is the sample SQL query.SELECT "ABC", "LAST_MODIFY_TIME"   FROMSYS.M_TABLE_STATISTICS ORDER BY “LAST_MODIFY_TIME" DESCIn above command, you need to replace “ABC” by your table name.

How to find all pairs of elements in Java array whose sum is equal to a given number?

Rama Giri

Rama Giri

Updated on 02-Aug-2019 14:05:01

6K+ Views

To find all pairs of elements in Java array whose sum is equal to a given number −Add each element in the array to all the remaining elements (except itself).Verify if the sum is equal to the required number.If true, print their indices.Exampleimport java.util.Arrays; import java.util.Scanner; public class sample { ... Read More

MySQL query to get the highest value from a single row with multiple columns

Rama Giri

Rama Giri

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

232 Views

To get the highest value, use the GREATEST() method. Let us first create a table −mysql> create table DemoTable    -> (    -> Value1 int,    -> Value2 int,    -> Value3 int    -> ); Query OK, 0 rows affected (1.29 sec)Insert some records in the table using ... Read More

How to check if a datetime value equals tomorrows date in MySQL?

Rama Giri

Rama Giri

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

269 Views

For this, you can use DATEDIFF(). Let us first create a table −mysql> create table DemoTable -> ( -> ShippingDate datetime -> ); Query OK, 0 rows affected (0.90 sec)Insert some records in the table using insert command −mysql> insert into ... Read More

MySQL query to delete all rows older than 30 days?

Rama Giri

Rama Giri

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

20K+ Views

To delete all rows older than 30 days, you need to use the DELETE with INTERVAL. Use < now() i.e. less than operator to get all the records before the current date.Let us first create a table −mysql> create table DemoTable    -> (    -> UserMessage text,    -> ... Read More

Count the number of distinct values in MySQL?

Rama Giri

Rama Giri

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

218 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Name varchar(100),    -> Code varchar(100)    -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris', '0001'); Query OK, 1 row affected ... Read More

Fetch records containing a specific character twice in MySQL

Rama Giri

Rama Giri

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

293 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Words text    -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Ever'); Query OK, 1 row affected (0.18 sec) mysql> insert ... Read More

How do I search and replace specific chars at the beginning of a string in MySQL?

Rama Giri

Rama Giri

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

239 Views

For this, you can use INSERT(). Let us first create a table −mysql> create table DemoTable    -> (    -> ZipCode varchar(200)    -> ); Query OK, 0 rows affected (0.47 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('9030'); Query OK, 1 row ... Read More

How to combine two tables and add a new column with records in MySQL?

Rama Giri

Rama Giri

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

515 Views

Let us first create a table −mysql> create table DemoTable1    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> Name varchar(100)    -> ); Query OK, 0 rows affected (0.76 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1(Name) values('Chris'); Query ... Read More

Previous 1 ... 3 4 5 6 7 ... 11 Next
Advertisements