Rama Giri

Rama Giri

87 Articles Published

Articles by Rama Giri

Page 2 of 9

How to return a random number between 0 and 199 with JavaScript?

Rama Giri
Rama Giri
Updated on 15-Mar-2026 471 Views

To return a random number between 0 and 199, use the JavaScript Math.random() and Math.floor() methods together. How It Works Math.random() generates a random decimal between 0 (inclusive) and 1 (exclusive). To get integers from 0 to 199: Multiply by 200 to get range 0 to 199.999... Use Math.floor() to round down to nearest integer Example // Generate random number between 0-199 let randomNum = Math.floor(Math.random() * ...

Read More

Adding a condition using SQL or an ABAP program and difference in performance

Rama Giri
Rama Giri
Updated on 13-Mar-2026 342 Views

When adding conditions to filter data, you can choose between implementing the logic in SQL or in an ABAP program. For small datasets like 500 records, there would not be much difference in performance between both options. You can use either of them based on your specific requirements. SQL Approach Using SQL WHERE clause directly in the database query is generally more efficient as it filters data at the database level − SELECT * FROM table_name INTO TABLE lt_table WHERE exp > 5. ABAP Program Approach Alternatively, you can ...

Read More

Getting details when a table is modified in SAP HANA DB

Rama Giri
Rama Giri
Updated on 13-Mar-2026 2K+ Views

You can query SYS.M_TABLE_STATISTICS to get modification details by providing the table name and checking the LAST_MODIFY_TIME column. This system view contains statistical information about tables including when they were last modified. Query Syntax Here is the sample SQL query to retrieve table modification details − SELECT "TABLE_NAME", "LAST_MODIFY_TIME" FROM SYS.M_TABLE_STATISTICS WHERE "TABLE_NAME" = 'YOUR_TABLE_NAME' ORDER BY "LAST_MODIFY_TIME" DESC; In the above command, you need to replace YOUR_TABLE_NAME with your actual table name. Example To get modification details for a table named EMPLOYEES − SELECT "TABLE_NAME", "LAST_MODIFY_TIME" FROM ...

Read More

Get the number of rows in a particular table with MySQL

Rama Giri
Rama Giri
Updated on 30-Jun-2020 226 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> LastName varchar(100)    -> ); Query OK, 0 rows affected (0.68 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Smith'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values('Miller'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('Taylor'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('Brown'); Query OK, 1 row affected (0.29 sec)Display all records from the table using select statement −mysql> select *from DemoTable;OutputThis will produce ...

Read More

How to create and fill a new column in an already created MySQL table?

Rama Giri
Rama Giri
Updated on 30-Jun-2020 1K+ Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Value1 int,    -> Value2 int    -> ); Query OK, 0 rows affected (0.77 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10, 10); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values(20, 30); Query OK, 1 row affected (0.24 sec)Display all records from the table using select statement −mysql> select *from DemoTable;OutputThis will produce the following output −+--------+--------+ | Value1 | Value2 | +--------+--------+ |     10 |   10 | ...

Read More

MySQL query to find a value appearing more than once?

Rama Giri
Rama Giri
Updated on 30-Jun-2020 598 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> value int    -> ); Query OK, 0 rows affected (0.82 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values(100); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable values(20); Query OK, 1 row affected (0.28 sec) mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.34 sec) mysql> insert into DemoTable values(30); Query OK, 1 row affected (0.24 sec) ...

Read More

How to select return value from MySQL prepared statement?

Rama Giri
Rama Giri
Updated on 30-Jun-2020 955 Views

Let us create a stored procedure and select return value from MySQL prepared statement −mysql> DELIMITER // mysql> CREATE PROCEDURE return_value()    -> BEGIN    ->   SET @returnQuery= 'SELECT 98 INTO @value';    ->   PREPARE stmt FROM @returnQuery;    ->   EXECUTE stmt;    -> END    -> // Query OK, 0 rows affected (0.20 sec) mysql> DELIMITER ;Call stored procedure using CALL command.mysql> call return_value(); Query OK, 1 row affected (0.07 sec)Display value using select statement −mysql> select @value;outputThis will produce the following output −+--------+ | @value | +--------+ |     98 | +--------+ 1 row in set (0.00 sec)

Read More

How to count number of NULLs in a row with MySQL?

Rama Giri
Rama Giri
Updated on 30-Jun-2020 738 Views

Use ISNULL() from MySQL. Let us first create a table −mysql> create table DemoTable    -> (    -> Number1 int,    -> Number2 int    -> ); Query OK, 0 rows affected (0.59 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10, NULL); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values(NULL, NULL); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable values(29, 98); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values(NULL, 119); Query OK, 1 row affected (0.15 sec)Display all records ...

Read More

Display records ignoring NULL in MySQL

Rama Giri
Rama Giri
Updated on 30-Jun-2020 208 Views

Use IS NOT NULL to display only NOT NULL records. Let us first create a table −mysql> create table DemoTable    -> (    -> FirstName varchar(100)    -> ); Query OK, 0 rows affected (3.01 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John'); Query OK, 1 row affected (0.44 sec) mysql> insert into DemoTable values(NULL); Query OK, 1 row affected (0.58 sec) mysql> insert into DemoTable values('Chris'); Query OK, 1 row affected (0.31 sec) mysql> insert into DemoTable values(NULL); Query OK, 1 row affected (0.20 sec) mysql> insert into ...

Read More

How to get the seed value of an identity column in MySQL?

Rama Giri
Rama Giri
Updated on 30-Jun-2020 725 Views

For this, you can use SHOW VARIABLES command −mysql> SHOW VARIABLES LIKE 'auto_inc%';OutputThis will produce the following output −+--------------------------+-------+ | Variable_name            | Value | +--------------------------+-------+ | auto_increment_increment | 1     | | auto_increment_offset    | 1     | +--------------------------+-------+ 2 rows in set (0.95 sec)You can control over AUTO_INCREMENT outside.Let us first create a table −mysql> create table DemoTable    -> (    -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY    -> ); Query OK, 0 rows affected (0.94 sec)Insert some records in the table using insert command −mysql> insert into DemoTable ...

Read More
Showing 11–20 of 87 articles
« Prev 1 2 3 4 5 9 Next »
Advertisements