| | |
hOW TO INSERT NEW RECORD IN SEC TABLE?
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
By giving us some additional data like what is structure of these two tables?
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
There is nothing to update in first table Emp_id what links both tables. So if you trying to get salary of an employee you either have already person's ID or you will find out through matching of employee name and department against Emp table. Once you get that ID then you can query salary table for that person salary
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
There is nothing to reflect in first table. In reality you do want to only update salary in salary table. If you start adding new salaries with same employee ID how do will you find what is that person actual salary from numerous records you will have?
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
•
•
Join Date: Aug 2008
Posts: 22
Reputation:
Solved Threads: 0
Ya with the same Emp_id it will be ok but i wanta dd new Emp_id in sec table..
just want give more info like:
Emp table
Emp_id Emp_name
1 ABC
2 EFG
Salary table
Emp_id Salary
1 1000
2 2000
Now i want insert new rec in salary table with new Emp_id = 3 and salary = 3000;
I want Emp_id 3 should also reflect in first table as far as Emp_name concern it will null.
This is my Query.
Thanks
just want give more info like:
Emp table
Emp_id Emp_name
1 ABC
2 EFG
Salary table
Emp_id Salary
1 1000
2 2000
Now i want insert new rec in salary table with new Emp_id = 3 and salary = 3000;
I want Emp_id 3 should also reflect in first table as far as Emp_name concern it will null.
This is my Query.
Thanks
There is option to use triggers, but so far I had no time to test how does it work, or execute 2 insert statements one after other with same Emp_id
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Other Threads in the MySQL Forum
- Previous Thread: In Mysql Storing and retriving the image with asp.net
- Next Thread: Best way to query
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns cmg communityjournalism contentmanagement contractors copyright count court data database design developer development distinct drupal dui ec2 email enter enterprise eudora facebook form foss gartner gnu government gpl greenit groklaw hiring hyperic images innerjoins insert ip joebrockmeier join journalism keyword keywords kickfire law legal license licensing maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource oracle penelope php priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency virtualization






