Mith
Allen
Ward
Jone
Mith
Allen
Ward
Jone
Last new column display this type brother
But it works only in MySQL > 8.x versions
(
Select pro_com,max(pro_price) as price
from item_mast
group by pro_com
)
select a.pro_name, b.price, a.com_name
from company_mast a
join max_price b on a.com_id = b.pro_com
OR
Select DISTINCT pro_name as product_name, max(price) over (partition by a.pro_com) as price, com_name as company
from item_mast a
join company_mast b on a.pro_com = b.com_id
select a.pro_name, b.price, a.com_name
from company_mast a
Bro, it looks like table “company_mast a” has no column “a.pro_name”.
In that column values are condition: reference ename column values don’t want to S letter only in that column remaining words will display last new column
Is this ms-sql ?
In that column values are condition: reference ename column values don’t want to S letter only in that column remaining words will display last new column
— Step 1
alter table employee add column new_ename varchar;
— Step 2
update employee set new_ename =
trim(replace(ename,’S’,”));
….. Please respond

Anyone can solve this ?
There is no as such limit
1
Select * from messages
where conversarion_id in (
select X.id from
(
Select cast(datetime as date), id, row_number() over (partition by cast(datetime as date),id order by datetime) as rn
from conversations c
) X
where X.rn = 1
)
Select * from messages
where conversarion_id in (
select X.id from
(
Select cast(datetime as date), id, row_number() over (partition by cast(datetime as date),id order by datetime) as rn
from conversations c
) X
where X.rn = 1
)
For the second solution, have to change in where clause only , i.e. run =2
Yes thats correct
In that column values are condition: reference ename column values don’t want to S letter only in that column remaining words will display last new column
Got


You can start earning Bitcoin with our trusted and profitable
Platform π―fast payments and good rates
Contact Admin now for more information
Kindly
Click on this link
π©π©π©π©π©π©π©π©
ππππππππWelcome to Alpha Finance, we’re delighted to have you here. Please let us know how we can help you. WhatsApp: 16823373309
Kindly visit our website and signup you can place your investment directly from there www.alphafinance.live
πππππππππ
Clink on the link and contact Admin on how to start earning
(
Select pro_com,max(pro_price) as price
from item_mast
group by pro_com
)
select a.pro_name, b.price, a.com_name
from company_mast a
join max_price b on a.com_id = b.pro_com
OR
Select DISTINCT pro_name as product_name, max(price) over (partition by a.pro_com) as price, com_name as company
from item_mast a
join company_mast b on a.pro_com = b.com_id
It’s showing wrong answer bro
from item_mast a
join company_mast b on a.pro_com = b.com_id
group by pro_name,com_name
Answer is 6 records
It showing 9 records
alter table employee add column new_ename varchar;
— Step 2
update employee set new_ename =
trim(replace(ename,’S’,”));
Is this mySQL answer bro
Yes

It showing brother
Don’t say sorry brother.
Select * , replace(ename,’S’,”) from dummyemp
create table employee (ename text);
insert into employee values (‘SAA’),(‘SBB’);
ALTER TABLE employee add column hname text;
update employee set hname=trim(replace(ename,’S’,”));
select * from employee;
Ouput:
ename hname
SAA AA
SBB BB

MySQL query
Okay bro
It showing 9 records
create table company_mast (com_id int, com_name text);
create table item_mast (pro_id int, pro_name text, pro_price int, pro_com int);
insert into company_mast values (11,’Samsung’);
insert into company_mast values (12,’iBall’);
insert into company_mast values (13,’Epison’);
insert into company_mast values (14,’Zebronics’);
insert into company_mast values (15,’Asus’);
insert into company_mast values (16,’Frontech’);
insert into item_mast values (101,’Motherboard’,3200,15);
insert into item_mast values (102,’Keyboard’,450,16);
insert into item_mast values (103,’ZIP’,250,14);
insert into item_mast values (104,’Speaker’,550,16);
insert into item_mast values (105,’Monitor’,5000,11);
insert into item_mast values (106,’DVD’,900,12);
insert into item_mast values (107,’CD Drive’,800,12);
insert into item_mast values (108,’Printer’,2600,13);
insert into item_mast values (109,’Refill’,350,13);
with max_price as
(
select pro_com, max(pro_price) as price
from item_mast
group by pro_com
order by pro_com
)
select b.pro_name,a.price,c.com_name
from max_price a
join item_mast b on a.pro_com = b.pro_com and a.price = b.pro_price
join company_mast c on b.pro_com = c.com_id
order by a.price desc
Output:
pro_name | price | com_name
————- ——- ———–
Monitor | 5000 | Samsung
Motherboard | 3200 | Asus
Printer | 2600 | Epison
DVD | 900 | iBall
Speaker | 550 | Frontech
ZIP | 250 | Zebronics
create table item_mast (pro_id int, pro_name text, pro_price int, pro_com int);
insert into company_mast values (11,’Samsung’);
insert into company_mast values (12,’iBall’);
insert into company_mast values (13,’Epison’);
insert into company_mast values (14,’Zebronics’);
insert into company_mast values (15,’Asus’);
insert into company_mast values (16,’Frontech’);
insert into item_mast values (101,’Motherboard’,3200,15);
insert into item_mast values (102,’Keyboard’,450,16);
insert into item_mast values (103,’ZIP’,250,14);
insert into item_mast values (104,’Speaker’,550,16);
insert into item_mast values (105,’Monitor’,5000,11);
insert into item_mast values (106,’DVD’,900,12);
insert into item_mast values (107,’CD Drive’,800,12);
insert into item_mast values (108,’Printer’,2600,13);
insert into item_mast values (109,’Refill’,350,13);
with max_price as
(
select pro_com, max(pro_price) as price
from item_mast
group by pro_com
order by pro_com
)
select b.pro_name,a.price,c.com_name
from max_price a
join item_mast b on a.pro_com = b.pro_com and a.price = b.pro_price
join company_mast c on b.pro_com = c.com_id
order by a.price desc
Output:
pro_name | price | com_name
————- ——- ———–
Monitor | 5000 | Samsung
Motherboard | 3200 | Asus
Printer | 2600 | Epison
DVD | 900 | iBall
Speaker | 550 | Frontech
ZIP | 250 | Zebronics
I will check bro
create table item_mast (pro_id int, pro_name text, pro_price int, pro_com int);
insert into company_mast values (11,’Samsung’);
insert into company_mast values (12,’iBall’);
insert into company_mast values (13,’Epison’);
insert into company_mast values (14,’Zebronics’);
insert into company_mast values (15,’Asus’);
insert into company_mast values (16,’Frontech’);
insert into item_mast values (101,’Motherboard’,3200,15);
insert into item_mast values (102,’Keyboard’,450,16);
insert into item_mast values (103,’ZIP’,250,14);
insert into item_mast values (104,’Speaker’,550,16);
insert into item_mast values (105,’Monitor’,5000,11);
insert into item_mast values (106,’DVD’,900,12);
insert into item_mast values (107,’CD Drive’,800,12);
insert into item_mast values (108,’Printer’,2600,13);
insert into item_mast values (109,’Refill’,350,13);
with max_price as
(
select pro_com, max(pro_price) as price
from item_mast
group by pro_com
order by pro_com
)
select b.pro_name,a.price,c.com_name
from max_price a
join item_mast b on a.pro_com = b.pro_com and a.price = b.pro_price
join company_mast c on b.pro_com = c.com_id
order by a.price desc
Output:
pro_name | price | com_name
————- ——- ———–
Monitor | 5000 | Samsung
Motherboard | 3200 | Asus
Printer | 2600 | Epison
DVD | 900 | iBall
Speaker | 550 | Frontech
ZIP | 250 | Zebronics
π bro