Click here to Skip to main content
15,905,420 members
Home / Discussions / Database
   

Database

 
QuestionOne row at a time from a database table Pin
LucBite7-Jul-09 4:11
LucBite7-Jul-09 4:11 
AnswerRe: One row at a time from a database table Pin
Niladri_Biswas7-Jul-09 5:28
Niladri_Biswas7-Jul-09 5:28 
QuestionSubtotaling.. Am I doing it the wrong way?? Pin
Muammar©7-Jul-09 3:20
Muammar©7-Jul-09 3:20 
AnswerRe: Subtotaling.. Am I doing it the wrong way?? Pin
DoctorMick7-Jul-09 5:52
DoctorMick7-Jul-09 5:52 
GeneralRe: Subtotaling.. Am I doing it the wrong way?? Pin
Muammar©7-Jul-09 9:25
Muammar©7-Jul-09 9:25 
GeneralRe: Subtotaling.. Am I doing it the wrong way?? Pin
DoctorMick7-Jul-09 21:59
DoctorMick7-Jul-09 21:59 
GeneralRe: Subtotaling.. Am I doing it the wrong way?? Pin
Muammar©7-Jul-09 9:35
Muammar©7-Jul-09 9:35 
GeneralRe: Subtotaling.. Am I doing it the wrong way?? Pin
David Skelly7-Jul-09 22:58
David Skelly7-Jul-09 22:58 
It's impossible to tell how a database is structured just by looking at a screenshot. For all we know, that screen could have taken a long time to pull data in from lots of different tables and munge it around. Having said that, one possible table structure for this would be:

Table: ACC_GROUP
Id  Parent  Desc
1   NULL    Assets
2   1       Current Assets
3   2       Cash on Hand


Table: ACC
Id Group Number Name
1  3     1-1110 Checking Account
2  3     1-1120 Payroll Account
3  2     1-1300 Deposits Paid


From this, you can reproduce that screenshot. Don't forget, you don't have to do everything in one super-complicated SQL query statement. Sometimes it is OK to use cursors, or even (shock horror) to retrieve data and then manipulate it further in code (C#, Java, VB, COBOL, whatever your application happens to use). You won't win any points from the end users for writing clever code. They just want something that works.

But real-world accounting systems are usually more complicated than this so I doubt if that's how it is really done in this particular application. And it's not uncommon to find tables that hold pre-calculated sub-totals at the various levels in order to make displaying total grids like this quick and easy. Ideally you don't duplicate data in a database, but sometimes in the real world it's OK to make that compromise.
QuestionMultiple columns or one formatted column ? [modified] Pin
Hakmeh Mohannad7-Jul-09 0:48
Hakmeh Mohannad7-Jul-09 0:48 
AnswerRe: Multiple columns or one formatted column ? Pin
dan!sh 7-Jul-09 1:15
professional dan!sh 7-Jul-09 1:15 
AnswerRe: Multiple columns or one formatted column ? Pin
Eddy Vluggen7-Jul-09 1:17
professionalEddy Vluggen7-Jul-09 1:17 
AnswerRe: Multiple columns or one formatted column ? Pin
Jeremy Likness9-Jul-09 8:34
professionalJeremy Likness9-Jul-09 8:34 
QuestionSQL Query Pin
theCPkid6-Jul-09 15:41
theCPkid6-Jul-09 15:41 
AnswerRe: SQL Query Pin
Niladri_Biswas6-Jul-09 16:05
Niladri_Biswas6-Jul-09 16:05 
AnswerRe: SQL Query Pin
Niladri_Biswas6-Jul-09 17:00
Niladri_Biswas6-Jul-09 17:00 
GeneralRe: SQL Query Pin
theCPkid6-Jul-09 22:52
theCPkid6-Jul-09 22:52 
AnswerRe: SQL Query Pin
Mycroft Holmes6-Jul-09 20:06
professionalMycroft Holmes6-Jul-09 20:06 
GeneralRe: SQL Query Pin
Paul Unsworth6-Jul-09 22:19
Paul Unsworth6-Jul-09 22:19 
GeneralRe: SQL Query Pin
Mycroft Holmes6-Jul-09 23:07
professionalMycroft Holmes6-Jul-09 23:07 
GeneralRe: SQL Query Pin
theCPkid6-Jul-09 22:48
theCPkid6-Jul-09 22:48 
QuestionT-SQL USE with a variable Pin
TheComputerMan6-Jul-09 4:55
TheComputerMan6-Jul-09 4:55 
AnswerRe: T-SQL USE with a variable Pin
Blue_Boy6-Jul-09 6:13
Blue_Boy6-Jul-09 6:13 
GeneralRe: T-SQL USE with a variable Pin
TheComputerMan6-Jul-09 6:42
TheComputerMan6-Jul-09 6:42 
GeneralRe: T-SQL USE with a variable Pin
Blue_Boy6-Jul-09 7:09
Blue_Boy6-Jul-09 7:09 
GeneralRe: T-SQL USE with a variable Pin
TheComputerMan6-Jul-09 21:51
TheComputerMan6-Jul-09 21:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.