User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » What the hell is wrong w/ this SQL query? Page [1]  
aaronburro
Sup, B
52840 Posts
user info
edit post

SELECT (1=1);

seriously, SQL Server 2000 says this is not a valid query, what the fuck?

6/24/2007 4:05:17 PM

philihp
All American
8349 Posts
user info
edit post

what on earth are you trying to ask the server?

6/25/2007 1:04:21 PM

Aficionado
Suspended
22518 Posts
user info
edit post

i think he is looking for the meaning of the universe

6/25/2007 1:13:24 PM

Specter
All American
6575 Posts
user info
edit post

I second the "what the hell are you trying to do" question

6/25/2007 1:46:12 PM

synapse
play so hard
60929 Posts
user info
edit post

I third the "what the hell are you trying to do" question

6/25/2007 1:53:23 PM

evan
All American
27701 Posts
user info
edit post

i fourth it - what use would that ever have?

6/25/2007 2:35:38 PM

qntmfred
retired
40556 Posts
user info
edit post

http://thedailywtf.com/Contact.aspx

6/25/2007 2:39:26 PM

drhavoc
All American
3759 Posts
user info
edit post

What data are you trying to select (besides the obvious) and from which table(s)?

6/25/2007 4:46:37 PM

Fry
The Stubby
7781 Posts
user info
edit post

wow

6/25/2007 6:36:21 PM

synapse
play so hard
60929 Posts
user info
edit post

http://sqlzoo.net/ ftw

6/25/2007 6:46:43 PM

aaronburro
Sup, B
52840 Posts
user info
edit post

well, I was trying to run a query on a subquery which is perfectly valid, and it kept bitching at me around the area of the = sign, so I tried reducing it down to the area where it was complaining and making sure I was using the SQL right, and I reduced it down to that. crazy shit, aint it? I figured out another way to sort of accomplish my task.

6/25/2007 9:09:32 PM

bous
All American
11215 Posts
user info
edit post

your task sucks

6/26/2007 9:34:38 AM

philihp
All American
8349 Posts
user info
edit post

good to know you found another way of doing it. hopefully it was the correct way.

what was the original query?

6/26/2007 1:51:20 PM

aaronburro
Sup, B
52840 Posts
user info
edit post

Original query was something along the lines of:


SELECT
NOT EXISTS ('false')
FROM
(SELECT
(s.val = p.val)
FROM
somelongtable s,
anotherlongtable p
WHERE
s.id=p.id)


I know that what I wrote right there isn't syntactically correct, but I just pulled it off the top of my head. BTW, using <> didn't work either.

For the truly geeky among us, the reason it didn't work is that SQLServer2000 treats a '=' in the SELECT clause as if it were "AS". Thus, it was trying to use the second value as the name of a column, which makes absolutely no sense. go figure.

6/26/2007 6:10:50 PM

mourningwood
Suspended
227 Posts
user info
edit post

righto

6/27/2007 4:43:37 PM

philihp
All American
8349 Posts
user info
edit post

Delete that code. It's wrong. That's cool, though, because we're here to help. We're not here to judge.

Ask yourself, what is the goal of my query? What is the logical question i want to ask the database? It helps if you can phrase this along the lines of "Please give me all of the ______s, where they have a _______ in the _______ table"

6/27/2007 5:28:43 PM

 Message Boards » Tech Talk » What the hell is wrong w/ this SQL query? Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.