Selecting from and updating the same table oracle

10 Mar

create table new_hiretable as( select hiretable.* , monthtable.monthno from hiretable left join monthtable on hiretable.id=monthtable.id); It usually isn't a good idea to store redundant data - the month number can be extracted from the full date at run time, so storing it separately just gives you duplication and the potential for mistakes, if one column is updated and the other is not; and you have to set the extra column value, e.g. I'm also not sure if you really want the month number (with no reference to the year) or really want the hire month without the specific day, so I'll generate both.

See Section 19.6.4, “Partitioning and Locking”, for more information.Drop me an email and I will promptly and gladly rectify it.does not matter as long as the same order for returning the rows is enforced on both the master and the slave.The update query below shows that the PICTURE column is updated by looking up the same ID value in CATEGORY_ID column in table Categories_Test and Categories. If you need to update multiple columns simultaneously, use comma to separate each column after the SET keyword. Here we only want to update PICTURE column in Categories_Test table where the data in Category_Name column is Seafood in table Categories. Software and hardware names mentioned on this site are registered trademarks of their respective companies.Should any right be infringed, it is totally unintentional.