As far as I know MySQL doesn't support with
...
but you mentioned you are Oracle specific.
As far as I know MySQL doesn't support with
...
but you mentioned you are Oracle specific.
I see. But in seriousness. I should have mentioned its a reference table. It will never change. So my comment on f'd in the a was a joke, no one will ever change this table, if they do I will kill them with fire (I actually told them that for this project this table can never change....ever). Everyone is pretty clear about it.
Is the thinking that if you can do it without a subquery then that is the best route? It must be additional overhead on the DB?
Really? But all I need is the description. Explain.
SELECT q.*,(SELECT description FROM faqs_topics WHERE id=q.category) AS catDescription
FROM faqs_questions q
WHERE q.id NOT IN (SELECT questionid FROM faqs_answers)
ORDER BY q.createdate
Can someone tell me why this solution is substandard. @boomzilla didn't like it. But why?
I will change NOT IN
to NOT EXISTS
Like this:
WHERE not exists (SELECT 1 FROM faqs_answers WHERE questionid=faqs_questions.id)
But what else is wrong with it?
Yeah. I agree. @boomzilla has a solid no bullshit query.
select f., c.
from faqs_questions f
left join faqs_topics c on (c.id = f.category)
where not exists (select questionid from faqs_answers as z
where f.id = z.questionid)
order by f.createdate
Yes must have been...It checks out good work on that simple flip...You forgot the asterisks but it came back clean once I added them
select f., c.
from faqs_questions f
left join faqs_topics c on (c.id = f.category)
where not exists (select questionid from faqs_answers as z
where f.id = z.questionid)
order by f.createdate
Oh boy..That wasn't your fault. The markdown thieved your asterisks or something. Are we seeing a bug?
What? You really don't know how to invert it? Do you need help just getting relevant fields too? D:select f., c. from faqs_questions f left join faqs_topics c on (c.id = f.category) where not exists (select questionid from faqs_answers as z where f.id = z.questionid) order by f.createdate
…
select f., c.
from faqs_questions f
left join faqs_topics c on (c.id = f.category)
where not exists (select questionid from faqs_answers as z
where f.id = z.questionid)
order by f.createdate
I fucking see it now...Sorry about that.
I like it. I can read it. Very clean. (sorry for social engineering away from selecting specific columns, that was not an absolute condition)... Should have made that clear.
Ummm...I really like this part here:
WHERE not exists (SELECT 1 FROM faqs_answers WHERE questionid=faqs_questions.id)
Nicely done!!!!
I'm sorry, I am going to have to give you -19821374982347 for your lack of a 'cohesive' SQL query.
So far I have THREE functional was to do this query and one bork'd version.
Your lack of a solution speaks more volume. Even I hung my nuts out there which @boomzilla clearly kicked as soon as he saw his shot.
Filed under: FIFA on your nutsacks
And your solution? Or are you all chit-chat. (scrolling up...hmmm...I don't see it).
It cannot...(but if it does then I will be F'd in the A)
Looking at how your query is progressing, I think we may have different goals.
AND...there goes myself confidence..
Filed under: creative solutions are ok, I'm ok, your ok
I'm taking a look at your solution.
You are the subquery master (that deserves some respect)...You were coding inside out. Nice approach.
Ok...here is my own solution so you guys know I am in the competition.
SELECT q.*,(SELECT description FROM faqs_topics WHERE id=q.category) AS catDescription
FROM faqs_questions q
WHERE q.id NOT IN (SELECT questionid FROM faqs_answers)
ORDER BY q.createdate
Or maybe you are not impressed...?
Filed under: coding bunk-o free since 2003
I do not have to use all colums. I did that because each table has 3 to 8 columns and the data is light.
You're into the open source scene, aren't you.
No I just like it when people tell me "its wrong". So I deflect and say, "Ok, then fix it"...That usually shuts them up because it requires additional thinking. No more critic
(tapping feet), well then you better fix it...Since you have an opinion and all ;)
Filed under: Where is your solution.
Connection error...I see the error now.
SELECT f., c.
FROM faqs_topics c
RIGHT JOIN faqs_questions f ON (c.id = f.category)
LEFT JOIN faqs_answers a on a.questionid = f.id
WHERE a.questionid is null
ORDER BY f.createdate
Filed Under: You borked SQLFiddle.
Probably because my code had it to begin with. Its valid so what's wrong with right joins?
Shits and gigs...There is no purpose for it other than it was already there and I didn't want to remove it for this post
I was listening to the Google people dealing with the emergency evasion software. They said they are tuned to other drivers being dumb (gliding in and out of their lanes), collisions, and deer + other critters that flying in from out of nowhere.
Filed under: A.I. and you: How to let go and trust the machines
This is interesting information. I would it expect it to be the other way around.
Considering I only have a few fields in each table I think .* is ok. The only reservation I have is that I have ID and ID in two of the primary selected tables.
Considering I wasn't expecting any comments on it at all I would say this was Troll version scud.
In last Friday's poll I threw up a query, and some people reacted to it scud-missile style.
SELECT f.*, c.*
FROM faqs_topics c
RIGHT JOIN faqs_questions f
ON (c.id = f.category)
WHERE 1 = 1
AND f.id not in (select questionid from faqs_answers)
ORDER BY f.createdate
Here is a SQL fiddle. Everything is provided for you. I did make a table name change, but otherwise the select statement is unaltered.
The purpose of the SQL is to find unanswered questions and their topic.
How would you improve this? Paste your code and explanation as a response.
Difficultly bonus: You have to leave SELECT f.*, c.*
BUT you can change the f and c to something else but the .* has to stay (this is a bonus point so you can do whatever you want).
Yeah I creep out when I think of things like that. Lucky for me I have a few unique skills I can leverage to do damage and/or escape threats:
So you can see that I can dominate if confronted.
The thought po-po might want to think twice before sending their robot monkey's from the future to my crib.
So we went from anti-topical to topical...In order to keep up appearances, someone needs to talk about misandry or polls.
Oh? you have a bullshit day too?
Nothing beats bullshit like a pack of cats on your lap.
Your not from around here, are you?
Filed under: Just kidding mate.
I don't believe there is much availability of Firefox OS in the U.S. but I bet they will knock it out of the park (obviously you cannot do everything on mobile). I have a Samsung Galaxy Note 3 currently running Android 4.4.2
I scroll, but when things get unruly (as they get sometimes), I lean on the summary widget/box thing and constrain stuff that way.
If all posts were loaded (I know is insane in some cases), I would CTRL + F which is a marvel of modern science in itself.
I would use the search, but it doesn't search the way I think it should. I have requested they use the interns to build out a simple circa 1997 search page with some advanced filters, but I don't think there was much interest.
With search Sam made an adjustment to search your likes (my likes if I am searching), so I bookmark (star), like things, and track (sometimes) when things are relevant. I mostly take off the tracking after a few days.
So you asked about scrolling but I went into find relative content. Hmmm. maybe that is for another conversation.
Here is one you might like...Beck's 8-bit Gameboy Variations remixes...nice Nintendo pinky-plop music.
The book of mormon...and all southpark songs for that matter, are always pretty awesome to belt out in the office when people are not expecting you to break out into song.
Music? I linked my weekly top 5 spotify songs on my profile page...
Just in case one needs to freshen up thier track list, or not. (I'm always curious about what people are currently listening to).
Sam this looks like my speed here. I will do this when I get stuck. I will hit the github site to discern my target tables for the administration section.
Very simple/ helpful.thanks...
They understand there tools very well. That must be a nice feeling. I'll get there after I break 100 instances.
But for the record vanilla installs work very well. It only becomes a problem when I touch things.
Ok that image had a logout button, that made me feel more stupid than I already feel. You realize the button doesn't work when your site gets locked up. No buttons work.
There are 1000 things I don't know about discourse. I cannot discover things easily. Trust me I search meta.discourse to the point of exhaustion. Part of the problem is that I don't know what to look for or what to ask for when I need help.
I had this problem on the last time I got stuck...i couldn't log out and I was logged in on 2 computers plus my phone. So that's handy...ok. i may have more questions but this is a good start.
What?! What does that little gem do? (Edit nevermind just read your edit)What other url parameters do you guys have for maintenence and debug purposes? Link me a list of things available...
Does tacking on /logout in the administration section force a logout. I saw Sam writing about /logout somewhere.