UPDATE multiple rows using GROUP BY

Codes here !

Moderators: macek, egami, gesf

manognatha
New php-forum User
New php-forum User
Posts: 9
Joined: Tue Aug 16, 2011 10:35 pm

UPDATE multiple rows using GROUP BY

Postby manognatha » Wed Nov 13, 2013 10:04 pm

my table fields
a_id
date
period
rollno
attend
staff_idno

date period rollno attend staff_idno
2013-11-13 4 13VE1A0361 P SR034
2013-11-13 4 13VE1A0362 P SR034
I want to display data using group by date, period and update then change date or period so its update all rows
Plz help me

nanirao89
New php-forum User
New php-forum User
Posts: 4
Joined: Mon Nov 18, 2013 10:41 pm

Re: UPDATE multiple rows using GROUP BY

Postby nanirao89 » Thu Nov 21, 2013 10:53 pm

Hi manognatha,
Here is the sample update query using it i think you can write your own update query.

Update table1
Set name = 'High'
From table1
Join (Select max(age), type from Table1 group by Table1) t ON table.age = t.age;

HAVE A NICE DAY !


Return to “mySQL & php coding”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest