Hard Light Productions Forums
Off-Topic Discussion => General Discussion => Topic started by: Kazan on March 02, 2004, 11:24:59 am
-
SELECT * FROM cmppeople WHERE Pos_Type='Scientists' ORDER BY Pos_Type,Pos_SubType,OrderOverride,SUBSTRING(Name, 1+Length(Name)-Locate(' ', REVERSE(Name))), SUBSTRING(Name, 1, Length(Name)-Locate(' ', REVERSE(Name)))
-
I don't get it, this isn't like one of CP's math jokes is it?
-
Originally posted by 01010
I don't get it, this isn't like one of CP's math jokes is it?
Database query. I'd try to decipher it, but that colouring is giving me a headache :) *
* I know, I know - it's to clairfy the bracketing. But i never liked SQL: anyways
-
Probably has something to do with recent political/religious topics. :doubt:
-
HotSnoj: that comment was extremely presumptious and outright false
STFU ESAD
-
Kazan == :mad: :mad: :mad: :mad: :mad: most of the time
-
Originally posted by Kazan
HotSnoj: that comment was extremely presumptious and outright false
STFU ESAD
:wtf: am I suppose to think?
SELECT * FROM cmppeople WHERE Pos_Type='Scientists'
Also:
Probably has something to do with recent political/religious topics. :doubt:
-
HotSnoj: i work for DoE Ames Lab
you're suppose to think it has to do with my work - because IT DOES
-
Originally posted by Kazan
SELECT * FROM cmppeople
WHERE Pos_Type='Scientists'
ORDER BY Pos_Type,Pos_SubType,OrderOverride,
SUBSTRING(Name, 1+Length(Name)-Locate(' ', REVERSE(Name))), SUBSTRING(Name, 1, Length(Name)-Locate(' ', REVERSE(Name)))
Well, it's been about 11/2 years since I last looked at SQL, so allow me some leeway here.........especially as this is off the top of my head
SELECT * - show all record fields in the selected tuples
WHERE Pos_Type='Scientists' - I presume pos-type is a field name?
ORDER BY Pos_Type,Pos_SubType,OrderOverride,
SUBSTRING(Name, 1+Length(Name)-Locate(' ', REVERSE(Name))), SUBSTRING(Name, 1, Length(Name)-Locate(' ', REVERSE(Name)))
- ORDER BY - in terms of priority, I think it's left-right (high-low) - Poa_type field, Pos_SubType field, OrderOverride field,
- now this next bit is a little hazy in particular, due to my unfamiliarity with the inbuild funcitons -
SUBSTRING(Name, 1+Length(Name)-Locate(' ', REVERSE(Name))),
- the substring of the name field, taken from the last(?) whitespace
SUBSTRING(Name, 1, Length(Name)-Locate(' ', REVERSE(Name)))
- the substring of the name field, taken from the first(?) whitespace
So -
select and show all records
where pos_type (the field) is "Scientist"
order (the selected records) by Pos_type, Pos_SubType, OrderOverried, position of the last whitespace, position of the first whitespace (in order of priority)
Correct me it I'm wrong, it's nice to try and refresh these things from time to time.
EDIT: waittamo - this is (as a last resort)sorting by the length of the second or first name?
-
Originally posted by Kazan
HotSnoj: i work for DoE Ames Lab
you're suppose to think it has to do with my work - because IT DOES
not that i speak from any form of experience, i'm 16.
-
HotSnoj: i didn't say im 16 - are you quoting yourelf there
I am 20
-
That was his point, Kaz. He's quoting him self by way of explaining why he didnt grok.
-
i knew SQL when i was 16, i knew C++ when i was 14....
-
HotSnoj==Kazan returns false, thus you cannot draw a direct parallel between HotSnoj and Kazan.
-
althought i can say that his unspoken propsition of "if (age == 16) sql_knowledge = NONE" is invalid
-
knows(x, SQL) ^ age(x,16)
{x/"Kazan"}
=> unifiable / satisfiable
alternately,
~knows(x, SQL) ^ age(x,16)
{x/"hotsnoj"}
=> unifiable / satisfiable
-
Absolutely, Kazan, however, when one adds the all important quantifier "person == 'hotsnoj'" we get the proper test:
if ((age == 16) && (person == 'hotsnoj') sql_knowledge = NONE
That is valid.
-
mikhael - it is correct WITH The additional quantifier -- however just saying the origional is invalid - and that is what hotsnoj implied
-
To take a note from DG: This thread == :no: :no:
-
Originally posted by Kazan
mikhael - it is correct WITH The additional quantifier -- however just saying the origional is invalid - and that is what hotsnoj implied
When he said "I'm only 16", he specified himself (hence the "I'm", thus the quantifier was both necessary and implicit, thus the original is valid.
-
I know (my)SQL...to an extent.
Anyway, I looked again where I got that quote. I did it again damnit. Got two members mixed up, you and kasperl. damn.
Sorry Kazan. My sincerest apologies.
Oh and BTW, I'll be turning 18 in a few months
[EDIT] Yes, I did get what you were saying about me in pseudo-code.
-
Wait... you're 16.. and turning 18 in a few months?
Ohhh.. must be the leap year... right.. thats it...
-
Originally posted by Thorn
Wait... you're 16.. and turning 18 in a few months?
Ohhh.. must be the leap year... right.. thats it...
Surely that'd be 14-to-18?
-
[color=66ff00]Feh.
[/color]