Click here to Skip to main content
15,887,585 members
Home / Discussions / Database
   

Database

 
AnswerRe: SQL Query - append results Pin
Chris Meech5-Dec-12 6:55
Chris Meech5-Dec-12 6:55 
GeneralRe: SQL Query - append results Pin
AndreFratelli5-Dec-12 7:08
AndreFratelli5-Dec-12 7:08 
QuestionSQL 2008 Data Base Table Design suggestion Pin
VishwaKL4-Dec-12 23:36
VishwaKL4-Dec-12 23:36 
AnswerRe: SQL 2008 Data Base Table Design suggestion Pin
Simon_Whale4-Dec-12 23:43
Simon_Whale4-Dec-12 23:43 
GeneralRe: SQL 2008 Data Base Table Design suggestion Pin
VishwaKL4-Dec-12 23:47
VishwaKL4-Dec-12 23:47 
GeneralRe: SQL 2008 Data Base Table Design suggestion Pin
Simon_Whale4-Dec-12 23:51
Simon_Whale4-Dec-12 23:51 
AnswerRe: SQL 2008 Data Base Table Design suggestion Pin
PIEBALDconsult5-Dec-12 3:56
mvePIEBALDconsult5-Dec-12 3:56 
Question[HELP] how to using array in my case? (Query & PHP) Pin
jimmy.suharry4-Dec-12 20:14
jimmy.suharry4-Dec-12 20:14 
I've some data, there are
VB
RealData Balance 	 Sort by Desc
A  684 	 345 		 A  684 
B  60 	 -   		 E  308 
C  -   	 -   		 J  302 
D  -   	 -   		 I  273 
E  308 	 - 		 O  178 
F  -   	 -   		 H  140 
G  11 	 -   		 B  60 
H  140 	 - 		 N  27 
I  273 	 - 		 Q  22 
J  302 	 -   		 R  20 
K  -   	 -   		 P  14 
L  -   	 -   		 G  11 
M  -   	 -   		 C  -   
N  27 	 -   		 D  -   
O  178 	 38 		 F  -   
P  14 	 -   		 K  -   
Q  22 	 -   		 L  -   
R  20 	 4   		 M  -   

Description
Proc = Process
Res = Result
Sort by Desc

Get 8 row data 														
Proc 1  Res 1 	Proc 2  Res 2 	Proc 3 	 Res 3 	 Proc 4  Res 4 	 Finish for 8 row data
A  684  657 	A  657  635 	A  635 	 621 	 A  621  610 	 A  610  	
E  308  281 	E  281  259 	E  259 	 245 	 E  245  234 	 E  234 	
J  302  275 	J  275  253 	J  253 	 239 	 J  239  228 	 J  228 	
I  273  246 	I  246  224 	I  224 	 210 	 I  210  199 	 I  199 	
O  178  151 	O  151  129 	O  129 	 115 	 O  115  104 	 O  104 	
H  140  113 	H  113  91 	H  91 	 77 	 H  77 	 66 	 H  66 	
B  60 	 33 	B  33 	11 	R  20 	 6 	 B  11 	 -   	 R  6 	
N  27 	 -   	Q  22 	-   	P  14 	 -   	 G  11 	 -   	 B  -   	
Q  22 	 22 	R  20 	20 	B  11 	 11 	 R  6 	 6 	 G  -   	
R  20 	 20 	P  14 	14 	G  11 	 11 	 P  -    -   	 P  -   	
P  14 	 14 	G  11 	11 	Q  -   	 -   	 Q  -    -   	 Q  -   	
G  11 	 11 	N  -    -   	N  -   	 -   	 N  -    -   	 N  -   	
C  -    -   	C  -    -   	C  -   	 -   	 C  -    -   	 C  -   	
D  -    -   	D  -    -   	D  -   	 -   	 D  -    -   	 D  -   	
F  -    -   	F  -    -   	F  -   	 -   	 F  -    -   	 F  -   	
K  -    -   	K  -    -   	K  -   	 -   	 K  -    -   	 K  -   	
L  -    -   	L  -    -   	L  -   	 -   	 L  -    -   	 L  -   	
M  -    -   	M  -    -   	M  -   	 -   	 M  -    -   	 M  -   	

Result 	 1 	 27 
Result 	 2 	 22 
Result 	 3 	 14 
Result 	 4 	 11 

Total 1		 74 (For 8 row data)



Get 4 row data 														
Proc 1 	 Res 1 	 Proc 2  Res 2 	 Proc 3  Res 3 	 Finish for 4 row data
A  610 	 411 	 A  411  376 	 A  376  347 	 A  347  345 
E  234 	 35 	 O  104  69 	 O  69 	 40 	 O  40 	 38 
J  228 	 29 	 H  66 	 31 	 H  31 	 2 	 R  6 	 4 
I  199 	 -   	 E  35 	 -   	 J  29 	 -   	 H  2 	 -   
O  104 	 104 	 J  29 	 29 	 R  6 	 6 	 J  -    -   
H  66 	 66 	 R  6 	 6 	 E  -    -   	 E  -    -   
R  6 	 6 	 I  -    -   	 I  -    -   	 I  -    -   
B  -   	 -   	 B  -    -   	 B  -    -   	 B  -    -   
G  -   	 -   	 G  -    -   	 G  -    -   	 G  -    -   
P  -   	 -   	 P  -    -   	 P  -    -   	 P  -    -   
Q  -   	 -   	 Q  -    -   	 Q  -    -   	 Q  -    -   
N  -   	 -   	 N  -    -   	 N  -    -   	 N  -    -   
C  -   	 -   	 C  -    -   	 C  -    -   	 C  -    -   
D  -   	 -   	 D  -    -   	 D  -    -   	 D  -    -   
F  -   	 -   	 F  -    -   	 F  -    -   	 F  -    -   
K  -   	 -   	 K  -    -   	 K  -    -   	 K  -    -   
L  -   	 -   	 L  -    -   	 L  -    -   	 L  -    -   
M  -   	 -   	 M  -    -   	 M  -    -   	 M  -    -   

Result 	 1 	 199 
Result 	 2 	 35 
Result 	 3 	 29 
Result 	 4 	 2 
		
Total 2 	 265 (For 4 row data)


How to get this data using Query or Function? And how to using in PHP?
Please help!

Thank you.
Jimmy

modified 5-Dec-12 2:24am.

AnswerRe: [HELP] how to using array in my case? (Query & PHP) Pin
Mycroft Holmes4-Dec-12 20:38
professionalMycroft Holmes4-Dec-12 20:38 
GeneralRe: [HELP] how to using array in my case? (Query & PHP) Pin
jimmy.suharry4-Dec-12 20:56
jimmy.suharry4-Dec-12 20:56 
QuestionSQL query Date Sort Problem Pin
AnirbanM 23-Dec-12 3:09
professionalAnirbanM 23-Dec-12 3:09 
AnswerRe: SQL query Date Sort Problem Pin
Ingo3-Dec-12 4:42
Ingo3-Dec-12 4:42 
GeneralRe: SQL query Date Sort Problem Pin
AnirbanM 23-Dec-12 18:46
professionalAnirbanM 23-Dec-12 18:46 
AnswerRe: SQL query Date Sort Problem Pin
Eddy Vluggen3-Dec-12 5:20
professionalEddy Vluggen3-Dec-12 5:20 
GeneralRe: SQL query Date Sort Problem Pin
AnirbanM 23-Dec-12 18:48
professionalAnirbanM 23-Dec-12 18:48 
GeneralRe: SQL query Date Sort Problem Pin
Eddy Vluggen3-Dec-12 23:00
professionalEddy Vluggen3-Dec-12 23:00 
AnswerRe: SQL query Date Sort Problem Pin
Corporal Agarn3-Dec-12 5:46
professionalCorporal Agarn3-Dec-12 5:46 
GeneralRe: SQL query Date Sort Problem Pin
AnirbanM 23-Dec-12 19:12
professionalAnirbanM 23-Dec-12 19:12 
AnswerRe: SQL query Date Sort Problem Pin
PIEBALDconsult3-Dec-12 8:50
mvePIEBALDconsult3-Dec-12 8:50 
GeneralRe: SQL query Date Sort Problem Pin
Mycroft Holmes3-Dec-12 13:12
professionalMycroft Holmes3-Dec-12 13:12 
GeneralRe: SQL query Date Sort Problem Pin
PIEBALDconsult3-Dec-12 13:18
mvePIEBALDconsult3-Dec-12 13:18 
GeneralRe: SQL query Date Sort Problem Pin
Mycroft Holmes3-Dec-12 16:18
professionalMycroft Holmes3-Dec-12 16:18 
GeneralRe: SQL query Date Sort Problem Pin
PIEBALDconsult3-Dec-12 17:29
mvePIEBALDconsult3-Dec-12 17:29 
GeneralRe: SQL query Date Sort Problem Pin
AnirbanM 23-Dec-12 18:57
professionalAnirbanM 23-Dec-12 18:57 
GeneralRe: SQL query Date Sort Problem Pin
AnirbanM 23-Dec-12 18:52
professionalAnirbanM 23-Dec-12 18:52 

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.