Jump to content

return (normalization)


oosrikanth

Recommended Posts

joining register table dno employee table dno result is below two tableregister table dno -- department -- deparment salary101 data processing 50,000102 printing 100,000103 design 250,000 employees 101 101/1 john101 101/2 james101 101/3 abott102 102/1 able102 102/2 adison103 103/1 alien103 103/2 alex103 103/3 alin103 103/4 casper out of above query below i need like below belt register table dno -- department -- deparment salary101 data processing 50,000102 printing 100,000103 design 250,000 employees 101 101/1 john101 101/2 james101 101/3 abott102 102/1 able102 102/2 adison103 103/1 alien103 103/2 alex103 103/3 alin103 103/4 casper out of above query below i need like below belt D NO DEPT D NO E NO E NAME101 data pro 101 101/1 john101 data pro 101 101/2 james101 data pro 101 101/3 abott102 printing 102 102/1 able102 printing 102 102/2 adison103 design 103 103/1 alien103 design 103 103/2 alex103 design 103 103/3 alin103 design 103 103/4 casper In need like this below "boolean" please take 1 min excuseD NO DEPT D NO E NO E NAME101 data pro 101 _______ 101/1 john_____________________101/2 james_____________________101/3 abott102 printing 102 _______ 102/1 able_____________________102/2 adison103 design 103 _______ 103/1 alien_____________________103/2 alex_____________________103/3 alin_____________________103/4 casper

Edited by oosrikanth
Link to comment
Share on other sites

linkhttp://4.bp.blogspot...20/untitled.JPG
I can't read the text in that image, it's too small. I still don't understand what you're asking for, I can't understand the way you talk. If you want to display this result set: D NO DEPT D NO E NO E NAME101 data pro 101 101/1 john101 data pro 101 101/2 james101 data pro 101 101/3 abott102 printing 102 102/1 able102 printing 102 102/2 adison103 design 103 103/1 alien103 design 103 103/2 alex103 design 103 103/3 alin103 design 103 103/4 casper like this: D NO DEPT D NO E NO E NAME101 data pro 101 _______ 101/1 john_____________________101/2 james_____________________101/3 abott102 printing 102 _______ 102/1 able_____________________102/2 adison103 design 103 _______ 103/1 alien_____________________103/2 alex_____________________103/3 alin_____________________103/4 casper then that is not a SQL question, you'll need to format that in whatever language you're using to display or save the results.
Link to comment
Share on other sites

<quote>then that is not a SQL question, you'll need to format that in whatever language you're using to display or save the results.</quote>said by other user "question but it seems you want blank rows instead of repeating values. In this case, you just want a list of depts with associated employees, but you don't the dept listed over and over. SQL does not easily support this. You could use domain aggregate functions to count the occurrences of specific value in a field, and when it exceeds 1, display null, but that is quite contrived. You could also use 'group by' subqueries with count() to see if you should populate the field or not. Again - quite contrived and a lot of work." "As a side note, your employee number is open to RI issues. If you change an employees dept, the number would also have to be change. I think that would violate 3rd normal form. Better would be to let the database create an autogenerated number for each employee, and then concatenate that to the dept number as a calculated field." best, any query using reference 1 please post me

Edited by oosrikanth
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...