22 April 2024
[SGE] Watcher xI have a table students. It has a column students_id other than id. It is in natural order (1-5) i just want to changes its values with odd numbers only.
For example:
Student_id= 1,2,3,4,5
To
Student_id= 1,3,5,7,9
In Mysql
update Students as s
Set students_id = (Select 2*(s.rowid-1)+1 from Students)
Where students_id=s.rowid;
23 April 2024
24 April 2024
Angel ShibuCustomer_ID and customer_name with orders placed in the year of 2007. How to write this query
Select customer_ID, customer_name from customer where ordersplaced like '%2017%';
id 1399086096Select customer_ID, customer_name from customer where ordersplaced like '%2017%';
Replace the column name if ordersplaced column is different
26 April 2024
27 April 2024
30 April 2024