Click here to Skip to main content
15,888,202 members
Home / Discussions / Database
   

Database

 
Questionneed code sample Pin
jqt4-Oct-06 19:17
jqt4-Oct-06 19:17 
AnswerRe: need code sample Pin
japel5-Oct-06 0:44
japel5-Oct-06 0:44 
Questionselect with TOP and COUNT Pin
CandyMe4-Oct-06 17:26
CandyMe4-Oct-06 17:26 
AnswerRe: select with TOP and COUNT Pin
albCode4-Oct-06 21:06
albCode4-Oct-06 21:06 
GeneralRe: select with TOP and COUNT Pin
CandyMe4-Oct-06 22:05
CandyMe4-Oct-06 22:05 
GeneralRe: select with TOP and COUNT Pin
albCode4-Oct-06 22:08
albCode4-Oct-06 22:08 
AnswerRe: select with TOP and COUNT Pin
Eric Dahlvang5-Oct-06 5:22
Eric Dahlvang5-Oct-06 5:22 
GeneralRe: select with TOP and COUNT Pin
CandyMe5-Oct-06 18:00
CandyMe5-Oct-06 18:00 
I mean my query doesn't produce the result I'm expecting.

For instance, I selected Top 5 with a given condition. But 3000 passed this condition. Rowcount should only be 5.

Upon querying such
Select top 5 LastName, <br />
(Select count (*) from TBL where lastname = 'Cruz') as Count <br />
from TBL where lastname = 'Cruz'


it gives me: the top 5. but doesn't give me the correct count: 5
LastName | Count
Cruz | 3000
Cruz | 3000
Cruz | 3000
Cruz | 3000
Cruz | 3000

Thank u.

Gerri

GeneralRe: select with TOP and COUNT Pin
CandyMe5-Oct-06 19:41
CandyMe5-Oct-06 19:41 
AnswerRe: select with TOP and COUNT Pin
templarx5-Oct-06 22:08
templarx5-Oct-06 22:08 
GeneralRe: select with TOP and COUNT Pin
CandyMe7-Oct-06 2:17
CandyMe7-Oct-06 2:17 
Questiondatetime Pin
lakshmi_sri4-Oct-06 15:01
lakshmi_sri4-Oct-06 15:01 
AnswerRe: datetime Pin
Edbert P4-Oct-06 16:39
Edbert P4-Oct-06 16:39 
AnswerRe: datetime Pin
Eric Dahlvang5-Oct-06 5:11
Eric Dahlvang5-Oct-06 5:11 
QuestionQuery Builder to make stored procedures? Pin
eggsovereasy4-Oct-06 10:43
eggsovereasy4-Oct-06 10:43 
Questiontext , ntext datatypes ( PLEASE HELP ) Pin
abdelhameed814-Oct-06 9:22
abdelhameed814-Oct-06 9:22 
AnswerRe: text , ntext datatypes ( PLEASE HELP ) Pin
Mark Salsbery4-Oct-06 10:44
Mark Salsbery4-Oct-06 10:44 
GeneralRe: text , ntext datatypes ( PLEASE HELP ) Pin
abdelhameed814-Oct-06 21:51
abdelhameed814-Oct-06 21:51 
GeneralRe: text , ntext datatypes ( PLEASE HELP ) Pin
Mark Salsbery5-Oct-06 6:26
Mark Salsbery5-Oct-06 6:26 
AnswerRe: text , ntext datatypes ( PLEASE HELP ) Pin
Jerry Hammond5-Oct-06 4:20
Jerry Hammond5-Oct-06 4:20 
QuestionDelete Row Count Pin
Skanless4-Oct-06 9:21
Skanless4-Oct-06 9:21 
AnswerRe: Delete Row Count Pin
Edbert P4-Oct-06 16:45
Edbert P4-Oct-06 16:45 
QuestionColumn Length Pin
Guinness4Strength4-Oct-06 7:50
Guinness4Strength4-Oct-06 7:50 
AnswerRe: Column Length Pin
Mark Salsbery4-Oct-06 10:56
Mark Salsbery4-Oct-06 10:56 
GeneralRe: Column Length Pin
Guinness4Strength4-Oct-06 11:00
Guinness4Strength4-Oct-06 11:00 

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.