...isn't as easy a task as I thought it would be. Especially if you're doing it across tables.
My initial attempt really didn't work so well. Looking through the Cheetah I was thinking subqueries might be the way. Unfortunately MySQL has no such thing just yet, at least in the stable version, 3.x, I'm using.
So I settled on using two searches (if needed). If two searches were needed then I took the intersection of the two sets, otherwise I just took the results from whatever search was performed.
I also had to put in a filter so that the results found were appropiate to the person viewing them. This is for a ticketing type of system so only customers should only be to see results pertinent to them or their customers.
Well, that was the biggest bit of coding today, basically rewriting code I wrote yesterday. You gotta love how the better idea comes to your after a user finds defects in it and you figure out to fix it.
Well, tomorrow is sort of a thinking day. I need to read some manuals and do some planning for a couple of other projects. Woo. Hoo. Beats being unemployed I suppose.
MySQL (Score:1)
---ict / Spoon
Re:MySQL (Score:1)
I'll probably need to move to PostGres or something else if the traffice really picks up, but MySQL does what I need to do and what it can't do I'm finding solutions.
Dude (Score:1)
JeffK
What was that other guys problem? You run into those jerks everywhere.
Re:Dude (Score:1)
I'm currently looking at Tomcat to see if a java servlet can run on it. I might have to use win2k for that since the company that created the servlet (and assoicated apps) is windows only. I would like to stay on Linux/Apache but I may have to move to win2k/Apache. I hope I won't have to go win2k/IIS.
I think the biggest problem with the search script is that I'm potentially querying 2 tables. With no subqueries I had to make 2 queries and then merge them. Not that big
Try this (Score:1)
# max_salary table to get the names of the
# employees with the highest salary.
#
SELECT employee_name
FROM employee, salary, max_salary
WHERE employee.employee_id = salary.employee_id
AND salary = max_salary
---------------------------------------------------------------
SELECT employee_name
FROM employee, salary
WHERE employee.employee_id = salary.employee_id
AND salary = (SELECT MAX(salary.salary) FROM
salary);
------
Re:Try this (Score:1)
Know of any good SQL books? I suppose I should poke around the usenet archives, but I'm lazy and like to get recommendations before I spend money on an area I'm not so knowledgeable.
Re:Dude (Score:1)
I was merely asking after his reasons in using MySQL. It was only due to the mention of having trouble trying to do something that MySQL doesn't support and, as you noted, have to kludge around.
fwiw, as gizmo noted: Postgres is also nice, and as free as MySQL. Hmm. And has solid transaction support =)
I tried Oracle - ate my machine. Helps to have more than 128Mb RAM. A
---ict / Spoon
Re:Dude (Score:1)
I was talking about the other guy you mentionned.
I agree about Postgres. Everyone has there own
reasons for everytihng they use. I mean
do people really like to use Word or do
they have to?
Again I'm sorry for the confusion. What does
OTT mean?
JeffK
Re:Dude (Score:1)
I've always assumed that people use Word because they either have to or that they don't know any better - or that anything better is too much effort. I mean, I praise LaTeX and TeX to the heavens. Wouldn't live without them. But there's one hell of a learning curve. Now TechWriter, on the other hand, that's a wonderful program. GUI based (not quite
---ict / Spoon
Re:Dude (Score:1)
Oh well, we all have burdens to bear.
temp tables (Score:1)
Re:temp tables (Score:1)
I really need to sit down and read some db books. I have "Database Design for Mere Mortals" which seems rather good so far as it is an intro for design. I not so sure what else I'll need to know other than learning via the school of hard knocks.