I was under the impression that I was your big comfy blanky.

Oz ,'Him'


Buffistechnology 3: "Press Some Buttons, See What Happens."

Got a question about technology? Ask it here. Discussion of hardware, software, TiVos, multi-region DVDs, Windows, Macs, LINUX, hand-helds, iPods, anything tech related. Better than any helpdesk!


Jessica - Jun 04, 2009 9:49:28 am PDT #10291 of 25501
And then Ortus came and said "It's Ortin' time" and they all Orted off into the sunset

Ooh - it's like a GIANT iPod Touch.


amych - Jun 04, 2009 10:18:30 am PDT #10292 of 25501
Now let us crush something soft and watch it fountain blood. That is a girlish thing to want to do, yes?

I was JUST coming in to post an OMGWANT about the CrunchPad.

tommyrot, if you're gonna live in the other half of my brain, how 'bout getting my to-do list done while you're there?


tommyrot - Jun 04, 2009 10:24:09 am PDT #10293 of 25501
Sir, it's not an offence to let your cat eat your bacon. Okay? And we don't arrest cats, I'm very sorry.

how 'bout getting my to-do list done while you're there?

Sure! As long as you fix this bug that's making stuff round wrong in the SQL Server/MS Access application I'm working on....


brenda m - Jun 04, 2009 10:25:12 am PDT #10294 of 25501
If you're going through hell/keep on going/don't slow down/keep your fear from showing/you might be gone/'fore the devil even knows you're there

Oh man. Want.


§ ita § - Jun 04, 2009 11:15:52 am PDT #10295 of 25501
Well not canonically, no, but this is transformative fiction.

Shiny pretty.

Theoretical SQL question: Given a table with the columns employee number, department, and salary, can you create a SQL statement that lists the highest salary per department where the maximum salary is over $50K?

I get that you need to use the max function, a FROM subquery, and group by, but I'm blanking beyond that.

SELECT MAX(top_salary) FROM (SELECT salary AS top_salary FROM salary_table GROUP BY department) WHERE top_salary>50000

maybe?


tommyrot - Jun 04, 2009 11:29:12 am PDT #10296 of 25501
Sir, it's not an offence to let your cat eat your bacon. Okay? And we don't arrest cats, I'm very sorry.

I'm confused.

Do you want the highest salary of each department, but only if the maximum salary for that department is > 50,000?


§ ita § - Jun 04, 2009 11:35:26 am PDT #10297 of 25501
Well not canonically, no, but this is transformative fiction.

Yes.


tommyrot - Jun 04, 2009 11:38:37 am PDT #10298 of 25501
Sir, it's not an offence to let your cat eat your bacon. Okay? And we don't arrest cats, I'm very sorry.

That's easy. Unless you want the employee number of the highest salary for each department as well. Then you need either a sub-select or the HAVING clause, I think.


§ ita § - Jun 04, 2009 11:39:39 am PDT #10299 of 25501
Well not canonically, no, but this is transformative fiction.

So is my suggestion correct?


tommyrot - Jun 04, 2009 11:45:19 am PDT #10300 of 25501
Sir, it's not an offence to let your cat eat your bacon. Okay? And we don't arrest cats, I'm very sorry.

But you wan the department as well, right? (If it has a top salary > 50k) So it'd be like

SELECT Max(test.salary) AS MaxOfsalary, dept
FROM salary_table
GROUP BY salary_table.dept
HAVING (((Max(salary_table.salary))>50000));

eta: You don't really need the HAVING here. It could just be:

SELECT Max(salary_table.salary) AS MaxOfsalary,
salary_table.dept
FROM salary_table
WHERE (((salary_table.salary)>50000))
GROUP BY salary_table.dept;

eta: I just now noticed one place where I had my test table name instead....