|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Tuesday, April 30, 2013 3:53 AM
Points: 94,
Visits: 235
|
|
create table data_dd(slno numeric(22),goals varchar(22),kpi varchar(22),weightage numeric(22),record_status char(8),empcode varchar(12),accyear date)
insert into(1,'webdevelopment',2451,40,u,002244,'2011-2012') insert into(6,'webdevelopment',2451,46,u,002244,'2011-2012') insert into(8,'webdevelopment',2451,46,u,001244,'2011-2012') insert into(9,'webdevelopment',2451,46,u,001244,'2011-2012')
create tabledata_ddlhistory( slno numeric(12),goals varchar(22),kpi varchar(12),date_of_commitment date,weightage numeric(12),goals_review_date date ,status char(22),reviewcomments varchar(22),reviewdate date,reviewedby varchar(22)
insert into(1,'web development',2451,'03-03-2011',45,'03-03-2011','u','perfect','1155')
in above two tables first tables is goals entry of employee and 2nd table is golas history reviewed by his boss
now expecting out is:
goals columns if he ve history means >>>>>>>>>> goals history comes like sub division
I am done procedure both tables separately...... now i ve doubt if employee ve history means how to display goals sub division of history in output
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Friday, April 19, 2013 3:36 PM
Points: 887,
Visits: 2,061
|
|
Your SQL is full of errors. Please fix and post correct statements.
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Tuesday, January 15, 2013 11:11 AM
Points: 1,945,
Visits: 2,782
|
|
Your DDL has no keys, no way to ever have a key because of the NULLs, the column names violate ISO-11179 rules. Your INSERT statement was wrong. The column sizes make no sense; the number of atoms in the Universe is well under a 22 digit number! The string '2011-2012' cannot ever be a DATE. Where you do have dates, you failed to use ISO-8601 formats.
Can you please post something that will compile? This non-SQL is useless.
>> in above two tables first tables is goals entry of employee and 2nd table is goals history reviewed by his boss <<
This design is wrong. All of the history of these goals should be in a single table. The design flaw you are trying to implement is called attribute splitting. We do not have enough specs or information or DDL to fix it. Want to try again?
Books in Celko Series for Morgan-Kaufmann Publishing Analytics and OLAP in SQL Data and Databases: Concepts in Practice Data, Measurements and Standards in SQL SQL for Smarties SQL Programming Style SQL Puzzles and Answers Thinking in Sets Trees and Hierarchies in SQL
|
|
|
|