Do we have any DB quarterly patching in MYSQL like we have in Oracle database?

|
Swapnil 2022-09-13 20:05:14
Varadamadhusudhan 2022-09-13 19:56:17
I want to update 10000 values in 1 table…. How can u do

Suppose i want to update 1000 ids i will follow below process

Create temp_table as
select * from table
where ids in (1000 ids);

then do the real update

Varadamadhusudhan 2022-09-13 20:22:07
1000 values we have entre
Swapnil 2022-09-13 20:29:55
Varadamadhusudhan 2022-09-13 20:22:07
1000 values we have entre

If possible can use subquery
Suppose you wana update 1st 1000 ids

Update tablename set column = somevalue
where id in (select id from tablename where id between 1 and 1000)

Rihanna Kate 2022-09-14 02:10:23
I canโ€™t explain how you make me feel right now Mr @Nathan_Carroll_50CB the joy in me is unexplainable i have made over $70,000 for the past 7days until now i am still making more money with the help of Mr @Nathan_Carroll_50CB and has legit company click on the link and message Mr @Nathan_Carroll_50CB right now and get started

https://t.me/joinchat/aW_4cgawzuZlY2M0
https://t.me/joinchat/aW_4cgawzuZlY2M0

Varadamadhusudhan 2022-09-14 03:31:25
Swapnil 2022-09-13 20:29:55
If possible can use subquery
Suppose you wana update 1st 1000 ids

Update tablename set column = somevalue
where id in (select id from tablename where id between 1 and 1000)

These 1000 values will entre by hand each one in querry

Biswajit Patnaik 2022-09-14 04:35:36
mysql_en-24965.jpg
This was the table I created to calculate median of lat_n
If I am removing round then it shows the answer else it shows this error message
Any solution to this?
Biswajit Patnaik 2022-09-14 04:36:08
mysql_en-24966.jpg
What does this error means how to rectify?
This query is similar to above but from an existing database
Swapnil 2022-09-14 08:54:00
Biswajit Patnaik 2022-09-14 04:35:36
mysql_en-24965.jpg
This was the table I created to calculate median of lat_n
If I am removing round then it shows the answer else it shows this error message
Any solution to this?

try casting the double precision to int like below
round(cast(avg(lat_n) as int), 4)

svart 2022-09-14 09:32:55
Varadamadhusudhan 2022-09-13 19:32:29
mysql_en-24965.jpg
Hi guys….

Plz help me..

If I update wrong data….how can I get previous data…..with SQL query

Analyze binary logs unless they expired. They have old and new state. So find your transaction and restore the data row by row

Swapnil 2022-09-14 14:31:17
v_plan_id := v_record_inner.plan_id;

END LOOP; — END OF v_record_inner

— If count is only one value then go for below logic
— For eg Plan D, which has only one usagerateslabs of 999999
ELSE

FOR v_record_inner IN (SELECT * FROM temp)
LOOP

v_slabrate_summation := (v_record_inner.usage – v_slabrate_summation);
v_slabrate_multiply_usage:= v_slabrate_summation*v_record_inner.slabs;

v_final := v_final+v_slabrate_multiply_usage;

v_plan_id := v_record_inner.plan_id;

END LOOP; — end of v_record_inner

END IF; — end of (v_cnt > 1)

— Setting the value to 0
— for next batch of processing
v_slabrate_summation:= 0;

— Updating Billvalue in base Table
— as per plan id
UPDATE test SET billvalue = v_final
WHERE plan_id = v_plan_id;

— Setting the value to 0
— for next batch of proce
v_final:=0;
v_flag:= ‘N’;

— Dropping temp table
— for next batch of processing
DROP TABLE temp;

END LOOP; — end of v_record_outer

END;

$$ language plpgsql;

select * from test;

Swapnil 2022-09-14 14:31:17
create table test (plan_id int, planname varchar, usagerateslabs text, usage int, billvalue int);

insert into test values (1, ‘PlanA’, ‘10000,0.25|10000,0.20|10000,0.15|99999,0.10’,33000,null);
insert into test values (2, ‘PlanB’, ‘5000,0.30|10000,0.25|15000,0.20|25000,0.15|99999,0.10’,33000,null);
insert into test values (3, ‘PlanD’, ‘999999,0.25’,33000,null);

DO
$$
DECLARE
v_current_slabrate int := 0;
v_slabrate_summation int := 0;
v_slabrate_multiply_usage int := 0;
v_final int := 0;
v_record_outer record;
v_record_inner record;
v_plan_id int;
v_cnt int;
v_flag varchar := ‘N’;

BEGIN

— Take one record at a time from base table
FOR v_record_outer in (select * from test)
LOOP

— Split single row into multiple rows after | symbol
— and store in temp table for further processing.
— For eg PlanA will be split up into 4 rows
— PlanB into 5 rows and Plan C into 1 row
— depending upon usagerateslabs
CREATE TABLE temp AS
SELECT v_record_outer.plan_id,
v_record_outer.planname,
split_part(usagerateslabs,’,’,1)::int as usage_rate,
split_part(usagerateslabs,’,’,2)::float as slabs,
v_record_outer.usage,
dense_rank () over (order by v_record_outer.plan_id) as rn
FROM unnest(string_to_array(v_record_outer.usagerateslabs, ‘|’)) usagerateslabs;

— Check how many rows a single row has split into
— depending upon | symbol as per above step

SELECT distinct count(rn)
INTO v_cnt
FROM temp;

— If more than one then go for below logic
IF (v_cnt > 1)
THEN
— Now depending upon single row split into N rows,
— process one row at a time
FOR v_record_inner IN (SELECT * FROM temp)
loop
— Process individual usagerateslabs one by one
v_current_slabrate := v_record_inner.usage_rate;

— For eg, Plan A, consider 1st usagerateslabs i.e 10000 < 33000
— then simple multiply 10000*0.25.
— Then take 2nd usagerateslabs again 10000, now we are doing summation
— with previous 1st usagerateslabs (10000+10000 = 20000) and then checking
— 20000 < 33000, if yes then again multiply 10000*0.20000
— and so on
IF ((v_current_slabrate+v_slabrate_summation < v_record_inner.usage) AND v_flag = ‘N’)
THEN
v_slabrate_summation := (v_slabrate_summation+v_current_slabrate);
v_slabrate_multiply_usage := v_record_inner.usage_rate*v_record_inner.slabs;

— For eg, Plan A,consider 4th usagerateslabs i.e 99999.
— Already we are doing summation in above step, where first 3 will
— be summed up as (10000+10000+1000 = 30000). Now if we sum up 99999 i.e
— (10000+10000+1000+99999 = 129999) which is > 33000, hence we will here
— subtract usage (33000) with summation of 1st 3 usagerateslabs (10000+10000+1000)
— which will give us 33000-30000 = 3000.
— Here we will set flag as Y so as if we reach usage of 33000 then going and checking
— next usagerateslabs does not make sense (In Plan B , 99999.0/10 does not make sense)
ELSIF ((v_current_slabrate+v_slabrate_summation > v_record_inner.usage) AND v_flag = ‘N’)
THEN
v_slabrate_summation := (v_record_inner.usage – v_slabrate_summation);
v_slabrate_multiply_usage:= v_slabrate_summation*v_record_inner.slabs;
v_flag := ‘Y’;

END IF;

— Calculating Billvalue by summing up the required usagerateslabs
— For eg. Plan A –> 10000*0.25 + 10000*0.20 + 10000*0.15 + 3000*0.10
v_final := v_final+v_slabrate_multiply_usage;

— Once Billvalue is calculated, setting value to 0 again
— for next batch of processing
v_slabrate_multiply_usage:= 0;

sylvia ttd 2022-09-14 16:41:52
Hello, At present due to various policies and bad news, the market has become very unstable. It is recommended to continue to wait and see, invest cautiously, and do not follow suit, I follow various strategies to know when it is a bit safe to pick trades some of those strategies could be found on telegram crypto groups, check it out: @MC900official

๐Ÿ˜—๐Ÿ’ฒ๐Ÿ’ถโš–๏ธ๐Ÿ‘๐Ÿ˜—๐Ÿ’ฒ๐Ÿ’ถโš–๏ธ๐Ÿ‘

Naveen K 2022-09-14 17:44:18
Hi please help

table name โ€˜history_sepโ€™ in this table column ‘File’ need to drop this column please any one give me query

Swapnil 2022-09-14 18:19:17
Naveen K 2022-09-14 17:44:18
mysql_en-24965.jpg
Hi please help

table name โ€˜history_sepโ€™ in this table column ‘File’ need to drop this column please any one give me query

Alter table history_sep drop column file;

Naveen K 2022-09-14 18:20:31
Swapnil 2022-09-14 18:19:17
mysql_en-24965.jpg
Alter table history_sep drop column file;

Thanks!

Shroff_azago 2022-09-14 18:47:09
Swapnil 2022-09-14 18:19:17
mysql_en-24965.jpg
Alter table history_sep drop column file;

Are bhai bhai BHAi thodi saans toh lelo

Swapnil 2022-09-14 19:12:17
Shroff_azago 2022-09-14 18:47:09
mysql_en-24965.jpg
Are bhai bhai BHAi thodi saans toh lelo

Q kya hogaya bhai ?๐Ÿ˜ฌ

Shroff_azago 2022-09-14 19:37:56
Swapnil 2022-09-14 19:12:17
mysql_en-24965.jpg
Q kya hogaya bhai ?๐Ÿ˜ฌ

Itna bda Code ๐Ÿ˜‚

Swapnil 2022-09-14 20:21:21
Shroff_azago 2022-09-14 19:37:56
mysql_en-24965.jpg
Itna bda Code ๐Ÿ˜‚

hahah code is not about length, its just about the logic bro๐Ÿคฃ

Biswajit Patnaik 2022-09-15 07:58:27
Swapnil 2022-09-14 08:54:00
mysql_en-24965.jpg
try casting the double precision to int like below
round(cast(avg(lat_n) as int), 4)

Thanks man it worked

J N S 2022-09-15 08:24:17
I need work support in vijaywada location
akki akki 2022-09-15 11:00:57
Can anyone hands on un sql server…??
Swapnil 2022-09-15 13:47:52
akki akki 2022-09-15 11:00:57
mysql_en-24965.jpg
Can anyone hands on un sql server…??

Ask your doubts in SQL SERVER group

Mr_khan_6959 2022-09-15 19:58:52
MySql ke practice Question provide kr skte ho ??????
smlkw 2022-09-15 20:01:45
Mr_khan_6959 2022-09-15 19:58:52
mysql_en-24965.jpg
MySql ke practice Question provide kr skte ho ??????

Use English, please

Mr_khan_6959 2022-09-15 20:02:19
Ohh sorry
Shroff_azago 2022-09-15 20:02:28
Mr_khan_6959 2022-09-15 20:02:19
mysql_en-24965.jpg
Ohh sorry

Khan saab

Shroff_azago 2022-09-15 20:02:32
Habibi
Mr_khan_6959 2022-09-15 20:02:53
Anyone have practice Question related to MySQL??
Shroff_azago 2022-09-15 20:03:03
Mr_khan_6959 2022-09-15 20:02:53
mysql_en-24965.jpg
Anyone have practice Question related to MySQL??

Google it

Mr_khan_6959 2022-09-15 20:03:19
Okay
Charan raj 2022-09-16 05:01:57
Dear frnds i have 4year experience as a support role.now I want change domain which one is better azureservice or any developer role like java,fullstack….suggest me please am in confusion
trilokinathvishnu 2022-09-17 07:01:19
Do we have any DB quarterly patching in MYSQL like we have in Oracle database?
samukhams 2022-09-17 08:20:43
Yes, MySQL do get quarterly release from Oracle
trilokinathvishnu 2022-09-17 16:22:37
samukhams 2022-09-17 08:20:43
mysql_en-24965.jpg
Yes, MySQL do get quarterly release from Oracle

Thank you!

|