-1

For example:

Select max(date)
From table A
Where max(date) < any (select..


                      ...)

Group By Book_Name,Client_Name

So the max(date) field could be compared to the Nestled Select return, as if the grouping of the greater Select was already made.

Mr Guliarte
  • 739
  • 1
  • 10
  • 27
  • What happens when you try it? Does it work? The great things about `SELECT` is that it can be tested without risk, because it's only a read operation. That means you can try anything you can possibly imagine without doing any damage if it doesn't work. (You can't `GROUP BY` columns that are not in the `SELECT`, of course, so the `SELECT` you've posted won't work, but it was hypothetical anyway. Right?) – Ken White May 10 '15 at 03:19
  • I've just posted a question at which I was informed that I can Group By columns not presented on select, but not the reverse... and I'm handwriting that, there is not a DB to test it here. – Mr Guliarte May 10 '15 at 03:59
  • So create a test DB. It takes about two minutes to do, and you'll learn something in the process on your own, much faster than you will have gotten an answer here. This site should be the *last resort* for help, after you've exhausted all other efforts to solve it yourself. Not even bothering to try something does not count as an "effort to solve it". – Ken White May 10 '15 at 04:13
  • Two minutes? It would be necessary to install a compatible DB, learn the basic comands, create a nice quantity of tables, and make the test having in mind the desired result.That's why I asked it here, supposing this is a site for knowledge storing and mutual helping. If you don't think that way, it's a pitty. – Mr Guliarte May 10 '15 at 14:52
  • You've apparently never heard of SQLFiddle. If you don't know the basic commands, find a tutorial or buy a book. We're glad to help here, but we expect some effort on your part to solve the problem yourself. We're not here to hold your hand, teach you the basics, or do your research for you. We're willing to help, but only those who are not helpless. – Ken White May 10 '15 at 15:25
  • I think different. As far as I see, If everyone was said to make huge reseraches on books and tutorials for every kind of doubt, Stack Overflow wouldn't be necesary. – Mr Guliarte May 12 '15 at 23:01
  • We expect people to **make an effort to solve it themselves first before posting here**, which includes finding tutorials to learn the basic commands and syntax. This is not a "hold my hand and teach me to program" site. Take the [tour] (which you agreed to have done by checking a box when you created your account) and visit the [help] to learn how this site is designed to work. We're not here to help those who won't make effort to help themselves first, no matter what you think. I'm quite a bit more familiar with this site than you are, and I'm quite sure how it's intended to work. – Ken White May 12 '15 at 23:05
  • Here's a [link to a Meta post](http://meta.stackoverflow.com/q/291866/62576) that discusses users who post questions here without doing the work to at least get a basic knowledge of a topic before posting here. I think it might be educational for you to read it (and see the votes and responses it received). – Ken White May 13 '15 at 00:14
  • I've made this same question at Stack Overflow in portuguese and got no observations like that. I just think that this way of thinking this site is absolutely wrong. First, not everyone has time to make researches for a question that here could be anwsered in minutes. Second, you could not demand for a beginner to know the precise limits between effort and the lack of it, since the guy barely knows what to search on Google. I know I'm not in position to make this observations, but it's just my opinion. And I didn't know SQL fiddlle. – Mr Guliarte May 16 '15 at 18:06
  • See what I mean by **no effort**? You couldn't even be bothered to do a simple Google search on *SQLFiddle*. We're not here to help the helpless. I've wasted enough time here with you; it's clear you're not interested in learning anything, or you'd be willing to invest a little effort in doing so instead of expecting everyone else to be your personal research assistants. I've linked you to what should have been an educational post at Meta, and you can't even be bothered to click that link and read it. You're the kind of user that pollutes this site with poor questions that end up deleted. – Ken White May 16 '15 at 18:29
  • One more piece of evidence that you're wrong: Go to any question and hover your mouse pointer over the downvote button, and read the text in the popup hint. It says **This question does not show any research effort; it is unclear or not useful.** If you're right, and this site does not expect users to at least *learn the basic commands or do research before asking*, why does that sentence start with **does not show any research effort**? – Ken White May 16 '15 at 19:02
  • Dude, I don't want to have you as an enemy. I really just want to give an opinion. If you don't want to accept it, it is all right. Just see this following link to know what I think: http://meta.stackoverflow.com/questions/251758/why-is-stack-overflow-so-negative-of-late Peace. – Mr Guliarte May 22 '15 at 00:47

1 Answers1

0

What you want is typically done with the HAVING clause.

Select Book_Name,Client_Name, max(date)
From table A
Group By Book_Name,Client_Name
HAVING max(date) < any (select..


                      ...)

I removed reference to the other answer. I don't think it was correct and doesn't really help because I think HAVING is what you need.

LoztInSpace
  • 5,584
  • 1
  • 15
  • 27