Skip to content

How do I create an automated calculated column?

Help me create a column, that shows the company’s budget. Let’s say we have three tables: Budget, Purchase, and Sale. When we selling products, the budget increases, when buying raw materials, it decreases. That is, automatically when you add a value to these tables, the budget value immediately c…

Difference between where and like in CLEARDB

I’m trying a simple nodejs login system and want to use the following query: “SELECT * FROM admin_cred WHERE username = ‘?’ AND password = ‘?’”, [username], [password] But it simply doesn’t …

Calculate percentage of SQL Group BY

The following SQL statement: SELECT FTR, COUNT(FTR) FROM football_data WHERE Matchday >= ‘2019-01-18’ GROUP BY FTR Returns the following result: Now I’m trying to get a percentage for each of …

oracle: format a number with slash

I have a column like this: Productnr 1 25 260 3700 51126 and I should write a query to display the column like this: productnr 0/01 0/25 2/60 37/00 511/26

Reset sequence to a specific value for test purposes

I’d like to reset sequence to specific value for test purposes. First decrement sequence with 100. After test execution I’ll increment sequence with 100. ALTER SEQUENCE seq_a RESTART WITH (SELECT MAX(…

weekly max count record in oracle

table test has column id,created_date,sal and data like below: ID create_date sal 1 20-JAN-2021 5000 2 20-JAN-2021 6000 3 19 -JAN- 2021 4000 we have data like this for each date. I pick the each day record count using below query: I want output for max record count for a weekly basis: count(*) create_date 500…