| |
| |
| |
|
Page: 1 2 3 4 5
Comments:
<upb> yep <upb> group by datetime, number <upb> and select max(duration) <IntaRob> thanks! that works great, but can I have it return the ID of the records as well? adding this into the select bring back the duplicate numbers <upb> yeah you cant like this <IntaRob> any other way of doing it? <IntaRob> i suppose I could sub query it if records where unique by number, date and duration... <Halo_Four> SELECT * FROM Calls AS a WHERE a.ID IN (SELECT TOP 1 b.ID FROM Calls AS b WHERE a.Date = b.Date ORDER BY b.Duration DESC) <IntaRob> halo_four, would this only select the longest duration call for each day? and not the longest duration call for each number for each day? <Halo_Four> add call to the mix <Halo_Four> er number or whatever <IntaRob> my date column contains a date and time. If i compare them then they wont match even if the day is the same...? <IntaRob> how can i compare the date parts only inline? <d2d_w0rk> drop time in both datetime <d2d_w0rk> and then compare <d2d_w0rk> IntaRob:: i do that a lot so i just created a function for it <d2d_w0rk> http://sql-servers.com/nopaste/?show=746 <IntaRob> thanks guys! works a treat! <ifreezeu> hi, i want to Transfer a MSDE 2000 table with all its data to a SQL 2005 database. Any help <homers> connect to the msde db via enterprise manager <homers> ah, but wait <homers> i dont know if you will be able to export it then... <ifreezeu> yes i have tried all that , i think <ifreezeu> it only lets me scipt table definition <homers> ah, it complains that the msde license does not allow an export, or? <ifreezeu> Ah but EM cannot connect to SQL 2005 <bealtine> use the 2k5 manager <homers> hm <ifreezeu> Is that the free version or the one with sql 2005 <bealtine> 2k5 one <bealtine> works fine for me <ifreezeu> 2K5 that comes with trial od SQL 2005 ? <bealtine> either works <ifreezeu> sorry whats the procedure u use ? <ifreezeu> i mean how do u export thru your tool <bealtine> import <ifreezeu> k thanks <ShrikeX> heh <ShrikeX> export through my tool <Drk`Angel> That should be a topic. <Drk`Angel> Really. <bealtine> heh <ifreezeu> k i dont see any export option in EM for 2005 express <ifreezeu> or import <bealtine> oh well adjust your gl***es <ifreezeu> lol, i did so <ifreezeu> honest its not <bealtine> must be broken so <bealtine> get dbase or something <ifreezeu> I think u r using the EM shipped with the sql 2005, which is not the express version <bealtine> then use Attach <ifreezeu> but what would that do, i still wouldnt be able to export from DB A to my desired DB B <bealtine> detach from 2k /copy the files /attach <ifreezeu> K then how do i after that, Table from DB A to DB B <bealtine> just get on with it <ifreezeu> lol i am trying <EyePulp> how do I resolve a deadlock that occurs on an update statement *Very* rarely in a scheduled DTS package? It's an update with a lot of inner joins. <dfworking> never ever update data <EyePulp> awesome. I'm on it, chief <dfworking> are the joins themselves responsible for the deadlock? <dfworking> like the halloween problem <EyePulp> That's the issue - I'm not sure what's causing the actual deadlock. <EyePulp> IIt's using several joins though, so it wouldn't surprise me. <dfworking> hold, i think i have a proc somewhere that can help you find it <dfworking> you can reproduce the deadlock? <EyePulp> nope <EyePulp> or at least not yet <dfworking> heh <EyePulp> It's very rare. <dfworking> let me find this thing it will be there for the next time then <dfworking> EyePulp: http://www.websolete.com/misc/GG%5FTSQL/ch17/code/ its from guru's guide for tsql (7), look at sp_find_root_blocker and sp_lock_verbose <HMS> hey in ms access when i do "Select RND(),* From HotPics Order By 1" is that suppose to give me a random row each time ? coz for some reason i get always the same one... <EyePulp> thx df - but when do I run this proc? <EyePulp> I never know when the block is occuring. <dfworking> when you've got the block <dfworking> maybe you can ferret out a way to be notified when there is a block from that code <EyePulp> I suppose I could put an onfailure from the update step in the DTS... <HMS> any1? <dfworking> hms, i don't think it will recalc the random number each iteration <HMS> is there a way to do it ? <HMS> how can i get a random row each time ? <dfworking> in access? no idea. why does the db need to be responsible for doing it anyway <EyePulp> have you googled for random results in access? <HMS> ya <HMS> and that what i found <EyePulp> does your random field change each time? <EyePulp> the value of it? <d2d_w0rk> dfworking:: is "http://www.websolete.com/misc/GG%5FTSQL/ch17/code/" a site maintained by "Ken Henderson"(of The Guru's Guide to T-SQL) by chance? <HMS> nop <HMS> ur right :) <dfworking> no, its my site where i uploaded the contents of the cd that comes with the book <dfworking> its the sql7 version, but i don't think much has changed <d2d_w0rk> oh i seee... 'khen@khen.com' looked awefully familiar ;) <EyePulp> so I don't ned to supply any sort of procID, I just run it and it grabs the most recent lock? <EyePulp> or deadlock? <dfworking> i believe so, never run them <dfworking> may want to check on www.sqlservercentral.com for similar routines people have written <november2> Does anyone see a problem with this SQL for Microsoft Access: SELECT * FROM ((DaysMeal JOIN MealTime ON DaysMeal.MealTimeID = MealTime.MealTimeID) x JOIN Meal ON x.MealID = Meal.MealID) <november2> I've tried everything I can, but I keep getting 'Syntax error in JOIN operation' <november2> If I remove either JOIN, it works fine. <HMS> err i still get the same row <HMS> Select * From HotPics Where AreaID = 1 Order By RND(ID) <HMS> i get the same row while i know there more then one result for that query <HMS> in access i get diff rows but on site i get the same one.. =\ <Guest2> what middleware, your query might be getting cached <HMS> cached where ? <Guest2> november2, why all the prins? and whats wrong with: select * from Daysmeal dm,mealtime mt,meal m where dm.MealTimeID=mt.MealTimeID and dm.mealid=m.mealid <Guest2> what middleware are you using for your website? <Guest2> sometimes an app server will cache a repeatedly used query when there haven't been an inserts or updates on the tables used <HMS> whats middleware ? <Guest2> nevermind, good luck <HMS> u mean server ? <HMS> its an iis server runing asp <november2> god <Drk`Angel> Yes? <november2> all I needed were parentheses <november2> access likes parentheses <november2> lol <november2> whhooooo, lunch time <november2> oh, needed parentheses and to say INNER JOIN instead of JOIN <Drk`Angel> Guest2: Please don't encourage people to use old now non-standard join syntax. The world is already confusing enough. <HMS> any1 pls <Guest2> drk'Angel, I got another idea worth considering take the new overly convoluted syntax and shove it up your ***, how about that on? <Guest2> lets make a simple 3 table join look like it took a lot of work <Guest2> HAHAHAHA <dfworking> its not overly convoluted, its more clear and can avoid certain issues with the older syntax in joins <Guest2> well when you get your first 1000line opus written like that, get back to me <dfworking> but please don't let me stand in the way of you defending using outdated methods of writing code <Guest2> jesus, some peoples kids <dfworking> eh, huh? <Guest2> what? <Guest2> huh? <Guest2> heh <dfworking> anything after my comment = eh, huh? <Guest2> get some experience before shooting your mouth off like a cad <dfworking> ah, the old 'anonymous irc guru shares his genius' trick <dfworking> and i'm probably older than you <Guest2> so you REALLY have no excuse then <dfworking> for what, having an opinion that differs from your absurd one? <dfworking> you are still using VB4 i imagine <dfworking> instead of that convoluted 'new' syntax <Guest2> yeah, opinions are like ***holes, everyone has one, you're just taking the party line ....ooo go out on a limb man...oooo <dfworking> right. <Guest2> never used VB at all, who EVER used that ****, I got an idea, this conversation is over <dfworking> yes, get out before it all unravels for ya there, big shot <dfworking> wouldn't actually want you to defend your opinions with rationale <Guest2> like I said, once you see some legacy code with 1000+ lines writtten like that and have to debug it, then we can talk, otherwise you're just being a blowhard <Guest2> so blow away <dfworking> okey dokey. as you said, the conversations over. at least i won't have to endure you talking **** anymore. <Guest2> ...and it's not just 'convoluted' it's 'needlessly over-convoluted' <dfworking> at least that parts clear now.
Return to
#sql or Go to some related
logs:
#beginner #computers #politics #delphi #winvista #unixhelp #windows babychef hi5 XDM authorization key matches an existing client +sarge Im still in love, but not with you
|
|