Click here to Skip to main content
15,897,891 members
Home / Discussions / Database
   

Database

 
QuestionHelp in creat this Sql Pin
Mangore7527-Dec-08 23:14
Mangore7527-Dec-08 23:14 
AnswerRe: Help in creat this Sql Pin
Mycroft Holmes28-Dec-08 14:51
professionalMycroft Holmes28-Dec-08 14:51 
GeneralRe: Help in creat this Sql Pin
Mangore7529-Dec-08 5:27
Mangore7529-Dec-08 5:27 
QuestionHow to substring the following Pin
dabuskol27-Dec-08 19:47
dabuskol27-Dec-08 19:47 
AnswerRe: How to substring the following Pin
Wendelius27-Dec-08 22:00
mentorWendelius27-Dec-08 22:00 
AnswerRe: How to substring the following Pin
Khawar Abbas129-Dec-08 20:22
Khawar Abbas129-Dec-08 20:22 
QuestionOnly include the latest rows Pin
Tony Pottier27-Dec-08 9:48
Tony Pottier27-Dec-08 9:48 
AnswerRe: Only include the latest rows Pin
Wendelius27-Dec-08 10:01
mentorWendelius27-Dec-08 10:01 
Limit doesn't work because you are actually groupping everything into a single row. If you want to restrict the data that goes into the group operation, you have to do it in where or for example use inline views.

If you want to use where condition, it could be something like:
SELECT COUNT(*), SUM(price)
FROM Orders o1
WHERE cust_id=3
AND 50 <= (select count(*) 
           from Orders o2
           where o2.cust_id = o1.cust_id
           and o2.date < o1.date)


The need to optimize rises from a bad design.My articles[^]

GeneralRe: Only include the latest rows Pin
Tony Pottier27-Dec-08 10:29
Tony Pottier27-Dec-08 10:29 
GeneralRe: Only include the latest rows Pin
Wendelius27-Dec-08 10:37
mentorWendelius27-Dec-08 10:37 
GeneralRe: Only include the latest rows Pin
Tony Pottier27-Dec-08 10:48
Tony Pottier27-Dec-08 10:48 
GeneralRe: Only include the latest rows Pin
Wendelius27-Dec-08 11:01
mentorWendelius27-Dec-08 11:01 
Question[Message Deleted] Pin
hatan8627-Dec-08 9:44
hatan8627-Dec-08 9:44 
AnswerRe: MS Access Database update error help Pin
Wendelius27-Dec-08 9:50
mentorWendelius27-Dec-08 9:50 
GeneralRe: MS Access Database update error help Pin
hatan8627-Dec-08 10:19
hatan8627-Dec-08 10:19 
GeneralRe: MS Access Database update error help Pin
Wendelius27-Dec-08 10:27
mentorWendelius27-Dec-08 10:27 
QuestionI want to discuss about a web project.Can I? Pin
R111927-Dec-08 3:41
R111927-Dec-08 3:41 
AnswerRe: I want to discuss about a web project.Can I? Pin
Colin Angus Mackay27-Dec-08 10:36
Colin Angus Mackay27-Dec-08 10:36 
GeneralRe: I want to discuss about a web project.Can I? Pin
Jon_Boy30-Dec-08 14:29
Jon_Boy30-Dec-08 14:29 
GeneralRe: I want to discuss about a web project.Can I? Pin
Colin Angus Mackay30-Dec-08 15:10
Colin Angus Mackay30-Dec-08 15:10 
GeneralRe: I want to discuss about a web project.Can I? Pin
Colin Angus Mackay30-Dec-08 15:14
Colin Angus Mackay30-Dec-08 15:14 
AnswerRe: I want to discuss about a web project.Can I? Pin
Colin Angus Mackay27-Dec-08 10:42
Colin Angus Mackay27-Dec-08 10:42 
AnswerRe: I want to discuss about a web project.Can I? Pin
Rob Graham28-Dec-08 5:31
Rob Graham28-Dec-08 5:31 
AnswerRe: I want to discuss about a web project.Can I? Pin
Jon_Boy30-Dec-08 14:25
Jon_Boy30-Dec-08 14:25 
QuestionQuery Question Pin
gnjunge25-Dec-08 3:17
gnjunge25-Dec-08 3:17 

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.