Oprano Front Page


Go Back   Oprano Adult Industry Forums > The Business Of Porn - Closed For Posting > Legacy Archived Main Board

Notices

Legacy Archived Main Board Business chat and general industry chat. All participation is welcome. Dont post your fucking spam here.





Check Out YnotMail

The Original Oprano Flat Board (Thanks To Sarettah!)---
Oprano Swag Shop
"History Of Porn Timeline
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 06-18-2008   #2
Nymph
Industry Member
 
Nymph's Avatar
 
Join Date: Mar 2003
Location: The Redneck Riviera
Posts: 739
Default Re: Fucking SQL

Quote:
Originally Posted by sarettah View Post
ok, i thought i was going to find out that this was an issue in just SQLServer but I just tested and it is an issue in MYSql too. Probably all known about but I just discovered it so I am going to vent a bit.

Ok, you have two tables.

Table1:
Trans_id key
all the other fields

Table2:
Rec_id key
all the other fields

If you say "select trans_id from table2" you get an error, as you should because the column trans_id is not in table2.

However, if you run that as a sub query in a where clause it does not return an error. I am not sure what it returns (i suspect null) but whatever the fuck it returns matches fucking everything.

So a query like "delete from table1 where trans_id in (select trans_id from table2)" where you would expect it to throw an error instead matches every fucking record in table1 and hence deletes them all.

i did this originally, by accident, in SQLServer yesterday, wiping out 18,000 records when I expected to delete about 10.

I tested in MYSql just a minute ago on my server and it worked the same way.

i also tested in FoxPro on my desk top. It threw an error telling me that the trans_id column was missing. i love my FoxPro, i don't give a shit what anyone else says about it.




Dammit
Trying to understand this here....

You have one record, that has data in both tables? Couldn't you do a double query assuming that not all records would have the same data info in each table?
Nymph is offline   Reply With Quote
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump


All times are GMT -4. The time now is 01:14 PM..


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright Evil Empire Inc. 2006-2022