| |
| |
| |
|
Page: 1 2 3 4 5
Comments:
<0> lusers <1> if peoples only introduction to databases was a book by Codd or CJ date,t hey arent in the real world <0> wel, it isnt exactly the notes as I remember them, but close enough <0> http://www.his.se/upload/11170/TemporalSQL.pdf <2> I also worked with a guy who would read books on calculus and discrete math for fun. He was really really strange. <0> slide 16 seems to cover the storage aspect, and Drk`Angel it seems like its covered in the same way you explained <1> wow that dude tried to mix interval types with admin features and a whole bunch of other crap <0> anyone who reads manuals/study books for fun in guarentied weird <1> "it all has to do with time, ill make a powerpoitn about it" <1> lame <0> rjarett: I think the point was that if he was giving a lecture at a conference then these would be the pp slides he would use <0> not really "I like the idea of time in db's - I'll make pretty slides" <0> hes suppsed to be a big head on the sql council or something, but I cant find a homepage for him <3> hi :) <3> i dont supose anyone can tell me, if I have a select statement - SELECT @result = myid FROM table WHERE myid = 2 <3> if theres no matching record, what does @result have in it
<3> will it be NULL? <3> or does it retain its valueprior to the select? <4> it would be null <5> It will contain whatever it had prior to the statement <3> ok many thanks guys :D <5> DECLARE @x INTEGER; SET @x = 1; SELECT @x = value FROM table WHERE 1 = 0; PRINT @x; -- output would be '1' <4> i revise my answer: it will be null AND it will contain whatever it had prior to the statement <3> im seeing if my select actually returns any data or not, im thinking just checking if the postvalue has changed or not is probably the fastest method, rather than checking rowcounts and stuff <3> what do you think? <5> @@ROWCOUNT is probably the fastest method. <3> ooh theres an IF EXISTS as well isnt there <5> If you're returning the data to a client, use @@ROWCOUNT to determine if you found anything. EXISTS requires a subselect. <5> and the server populates @@ROWCOUNT either way anyway. <3> ok many thanks :) <2> running an SQL statement in a debugger: Estimated processing time of 88695440 exceeds time limit of 15 =P <3> a splashof pink in the sp designer with @'rowcount looks nicer too :P <3> cheers again guys, your stars <5> heh <6> hmmm, those slides look like they're from a P*** lecture... <2> if I'm doing a WHERE EXISTS(SELECT...) thing, I can't return anything from that subselect can I? <5> Nope <2> crap <5> The statement is optimized to do the least amount of work in order to determine if any single row might satisfy the query <2> hmm... well... for the rows that are in the EXISTS(SELECT) I need to return a SUM :P <7> That's not what exists is for. <2> I know <7> Probably need to unroll it and switch to a having count(*) > something if you actually need to get data out of it. <2> I'm not sure how to structure this to make it work <8> can download SQL EM? <2> Here's what I'm talking about, if anyone has time to look at it: http://sql-servers.com/nopaste/?show=279 <7> Gm0nEy: If you download the trial of sql server, it has em in it. <7> And em doesn't expire, so that's the best way to get it if you need it for, say, working with a msde db. <9> cubert, what dbms/version ? <2> DB2 on AS/400 V5R3 <7> What error do you get? <9> http://sql-servers.com/nopaste/?show=280 <7> (Not that I've ever used DB2, but maybe its something silly) <2> umm... just a sec <2> ODBC Error:SQL0122 - Column POREF# or expression in SELECT list not valid. <9> for the old query or the new one I just posted? <2> the old one, I'm trying yours now <9> k <2> gamble, I get this from yours: ODBC Error:SQL5001 - Column qualifier or table INVC undefined. <2> I've run into that before, I think I have to fully qualify the tables instead of using aliases <9> DOH! One sec <7> Might be able to fix the old one just by added a group by clause. Sicne the sum would require one. <2> I'll work on that <2> Drk`Angel: that's what Gamble did <2> brb, meeting time <7> But, Gamble's looks more efficent. <7> He dropped the exists too :) <9> http://sql-servers.com/nopaste/?show=281 <9> fixed that syntax error, sorry <9> actually (sorry) use this one: http://sql-servers.com/nopaste/?show=282 <9> i hosed the join somehow in my pasting <8> i need to put it on another machine <8> so someone else can use EM <9> Drk`Angel, that query working or what? <7> Dunno, ask cubert. Its his. ;) <9> lol sorry <9> cubert, you awol?
<7> I think he said something about a meeting. <9> ah <2> back <2> let me scroll back <2> now it's ODBC Error:SQL0199 - Keyword AS not expected. Valid tokens: FOR WITH FETCH ORDER UNION EXCEPT <2> TIMIZE. <2> I'll work on it, thanks <2> TheGamble: well... I need to only return rows that have all three items <2> it has to match all of the things in the WHERE clause, not just one <9> so it need to return PO's that have at least one of all three items? <2> no <2> PO's with all three of them in the POD field <2> POC is the header, POD is the detail <2> *hehe* <9> that's what i meant <9> so the PO's returned by the query will have at least one of all three items? <2> umm.. right <2> one set of all three <9> ok, next question: PO's comprised *only* of those three items, or any PO that has at least one of each? <2> at least one set of that combination <9> then you have to remove the INNER JOIN i added, and have 3 EXISTS() predicates, correlated to the PO, querying POD to ensure presence of all three items <2> I can't do it with just one EXISTS like I started with? <9> Nope. <2> then I guess I never was getting the data I expected :P <9> right. <9> ;) <9> pseudo: SELECT PO.* FROM PO WHERE EXISTS(ITEM1) AND EXISTS(ITEM1) AND EXISTS(ITEM3) <9> like tha <10> If I have 'abc' three times in a table column and 'xyz' two times in a table column, what SQL statement could I use to return ('abc' | 3)('xyz' | 2)? I tried COUNT(DISTINCT column) but that did not work <9> SELECT ColumnName, COUNT(*) FROM myTable GROUP BY ColumnName <10> perfect! thanks! <9> cubert, the prior query that you had with the EXISTS(IN('', '', '')) form was returning any PO that had at *least one* of the prescribed items in the IN('') clause <2> TheGamble: so I the same SELECT but do it three times, one for each item number <2> where exists(select...) AND exists (select...) AND exists(select...) <9> yes <9> and vary the WHERE clause on each EXISTS() predicate, one for each product type <7> Triple exists are fugy, imo. I'd try somethign more along these lines: http://sql-servers.com/nopaste/?show=283 <2> drk, wouldn't the Exists and Count be slower to execute? <7> Dunno, actually. Three exists vs one count. <7> Could go either way, really. <2> POD has about 2.5M rows <11> print on demand? <2> POD Detail =) <7> If you have an index on poitem, that shouldn't matter. <7> (Row count) <2> err.. PO Detail <11> purchase order? <2> yeah <11> ahhs <11> pos are fun too <11> po's <7> Really, its just a select, so you might as well try it both ways. Wouldn't hurt anything. :) <11> did that hurt? <7> Nope. <7> See? :) <11> :( <11> i guess he's right folks <2> there are no indexes in this database. Lovely huh <7> Oh, bleck. <11> hahaha <7> Yeah, the exists is probably faster then. But I'd try it anyways, just out of curiosity. :) <11> index dat mofo <7> 2.5m rows with no indexes. Nothing is goign to be fast. <11> lolz <7> Its just different degrees of slow. <11> my grandma is faster then that :( <8> hey is i have SELECT ID, ISNULL(firstname, ' ') + ' ' + ISNULL(middlename, ' ') + ' ' + ISNULL(lastname, ' ') AS FullNames FROM tblAUTHORS <8> can i do a SORT at the end? <11> sure <8> i mean ORDER <8> right
Return to
#sql or Go to some related
logs:
#unixhelp #nhl #beginner #hardware #politics zimyc husleter #cisco #beginner #firebird
|
|