Click here to Skip to main content
15,901,368 members
Home / Discussions / Database
   

Database

 
AnswerRe: how to view trigger in sql 2005 Pin
Eslam Afifi7-Apr-09 22:14
Eslam Afifi7-Apr-09 22:14 
AnswerRe: how to view trigger in sql 2005 Pin
anup keshari8-Apr-09 0:29
anup keshari8-Apr-09 0:29 
Questiontest Pin
sanket_patil1117-Apr-09 5:20
sanket_patil1117-Apr-09 5:20 
Answerwrong forum; bad subject line Pin
Luc Pattyn7-Apr-09 6:14
sitebuilderLuc Pattyn7-Apr-09 6:14 
QuestionCount Left Nodes Pin
.NET- India 7-Apr-09 2:05
.NET- India 7-Apr-09 2:05 
AnswerRe: Count Left Nodes Pin
Upen Nathwani28-Jul-11 8:06
Upen Nathwani28-Jul-11 8:06 
QuestionSelf Join and Aggregate Functions Pin
swjam7-Apr-09 1:19
swjam7-Apr-09 1:19 
AnswerRe: Self Join and Aggregate Functions Pin
Kevin Horgan7-Apr-09 3:44
Kevin Horgan7-Apr-09 3:44 
Hi,

Assuming the table is called "kh" and you want it ORDER BY Field1 you could try this. The syntax works with T-SQL (Sybase). You may need to amend it for your DB if different.

SELECT t1.PriKey,t1.Field1, t1.Field2,t1.Field3,t1.Field4
FROM kh t1 INNER JOIN (SELECT MAX(Field1) AS Field1,Field4 FROM kh GROUP BY Field4) t2 ON (t1.Field4 = t2.Field4)
WHERE t1.Field1 = t2.Field1
ORDER BY t1.Field1

I hope it helps.

Cheers,
Kevin
GeneralRe: Self Join and Aggregate Functions Pin
swjam7-Apr-09 13:09
swjam7-Apr-09 13:09 
QuestionWeb Synchronization without domain name Pin
vyasdev20096-Apr-09 21:46
vyasdev20096-Apr-09 21:46 
QuestionBest way to connect to SQL Server 2008 Pin
Just someone else6-Apr-09 6:32
Just someone else6-Apr-09 6:32 
AnswerRe: Best way to connect to SQL Server 2008 Pin
Mycroft Holmes6-Apr-09 12:11
professionalMycroft Holmes6-Apr-09 12:11 
AnswerRe: Best way to connect to SQL Server 2008 Pin
Vimalsoft(Pty) Ltd6-Apr-09 20:44
professionalVimalsoft(Pty) Ltd6-Apr-09 20:44 
QuestionIs there anything wrong with this sql statement, the db engineer always complains Syntax Error. Pin
AndieDu5-Apr-09 21:23
AndieDu5-Apr-09 21:23 
AnswerRe: Is there anything wrong with this sql statement, the db engineer always complains Syntax Error. Pin
Ashfield6-Apr-09 1:32
Ashfield6-Apr-09 1:32 
GeneralRe: Is there anything wrong with this sql statement, the db engineer always complains Syntax Error. Pin
AndieDu6-Apr-09 13:39
AndieDu6-Apr-09 13:39 
AnswerRe: Is there anything wrong with this sql statement, the db engineer always complains Syntax Error. Pin
Colin Angus Mackay6-Apr-09 2:36
Colin Angus Mackay6-Apr-09 2:36 
GeneralRe: Is there anything wrong with this sql statement, the db engineer always complains Syntax Error. Pin
AndieDu6-Apr-09 13:39
AndieDu6-Apr-09 13:39 
Questiondrop the primary key using a query Pin
prasadbuddhika5-Apr-09 17:35
prasadbuddhika5-Apr-09 17:35 
AnswerRe: drop the primary key using a query Pin
Shrinivas Singh5-Apr-09 19:46
Shrinivas Singh5-Apr-09 19:46 
AnswerRe: drop the primary key using a query Pin
Wayne Porter16-Nov-09 23:09
Wayne Porter16-Nov-09 23:09 
QuestionWhat is the best sql server 2008 for me ? Pin
E_Gold5-Apr-09 4:57
E_Gold5-Apr-09 4:57 
AnswerRe: What is the best sql server 2008 for me ? Pin
Luc Pattyn5-Apr-09 5:05
sitebuilderLuc Pattyn5-Apr-09 5:05 
QuestionSetting up security. Pin
Member 39725354-Apr-09 10:18
Member 39725354-Apr-09 10:18 
AnswerRe: Setting up security. Pin
Mycroft Holmes5-Apr-09 17:38
professionalMycroft Holmes5-Apr-09 17:38 

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.