Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Making subdivision on Procedure Expand / Collapse
Posted Saturday, August 25, 2012 1:58 AM


Group: General Forum Members
Last Login: Tuesday, March 17, 2015 1:20 AM
Points: 184, Visits: 466
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
Post #1350024
Posted Saturday, August 25, 2012 2:22 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Wednesday, April 1, 2015 1:47 PM
Points: 994, Visits: 2,237
Your SQL is full of errors. Please fix and post correct statements.
Post #1350026
Posted Monday, August 27, 2012 4:56 PM



Group: General Forum Members
Last Login: Yesterday @ 5:33 AM
Points: 1,945, Visits: 3,497
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
Post #1350646
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse