| |
| |
| |
|
Page: 1 2 3 4 5
Comments:
<0> return 2800 rows. And <0> 55000 + 288000 + 290000 + 1081 <0> All four tabels outer join <0> ill put the sql query up <0> http://sql-servers.com/nopaste/?show=260 <0> patient is 55000 and to two _rel tabels is the 288000 amd 290000 <1> this query is to find what, open bookings? <0> yeap. Its part of finding a avalible booking time <1> i think i'm not following your logic: you are left joining to the booking table, which i ***ume has one entry per booking entered, correct? <1> so, if a booking wasn't made, it has no entry in booking, yes? <0> yeap <1> so why left join to it <0> argh sorry. <0> It when showing bookins in the large picture <0> s/it/is <1> are there 'empty' bookings that sit waiting to be used?
<1> or do they simply not exist in the booking table <0> They do not exist. Its looking though the booking table and for thoes records it find it join the appropate two relation tabels on and some bookingnotifications <1> ok, you don't need the outer joins then <1> if there is no booking, there is no booking chair, or booking dentist <1> for that non existent booking <0> Hm youre right <1> not only that, there is no patient for a booking that doesn't exist <0> LOL... it just speeded up by a factor two... <1> change them all to inner joins i think <1> verify the result is what you need, but it doesn't seem necessary to outer join <0> yeap. ill take a round trip to check if it depends on the outer joins somewhere. Thanks <1> np <0> Went in and asking the main developer for the cause of outer joins. There where a reason.. it was for future development. Hehe.. .They will be removed until time is <1> thats a bull**** answer <1> its like you buying a bra just in case you grow large breasts in the future <0> Yeap :) Thats why it will be removed in future releases until time is :) <2> he <2> where do i put an index on my sql2000 table? on teh primarykey? <3> yes <2> good <4> hey guys. can anyone help me with a access report question? I am trying to create a report that displays all the fields in the db or one field in the db if an option is given. <4> I know I have to do this in vba, but is there a way to change/filter the existing recordset for the report? <5> heh <5> MattyT, come on over to #vba <4> k <6> hi! <6> I want to query by LIKE '%xxx%' in an SP (mssql). This works fine but if i replace it with LIKE '%@search%' it wont work. Any reason for this? <6> no matter what I set the @search variable to <1> LIKE '%' + @search + '%' i believe <6> hang on.. me try <6> hmm no <6> i still get results that doesnt include the @search <6> the syntax %xxx% is correct, right? <6> [select all records that contains xxx somewhere in column x] <1> yes <6> hmm.. looks correct. maybe i look at the wrong place <6> as long as I have LIKE '%text%' it works. When doing LIKE '%'+@search+'%' (@search = 'text') it fails <4> I thought that ms used "*" instead of "%" <4> may be mistaken though <6> dont think so (but yes in access) <6> it seem like its the syntax in the SP that is wrong somehow since it works if i hardcode it into the query <6> and its no syntax error, it just returns wrong records <6> if anyone cares: http://sql-servers.com/nopaste/?show=261 <1> are you checking a 'list' of numbers? <1> if so, what you have is terribly inaccurate <6> sortow <6> the list looks like 8030,1234,3453,1232 <6> etc <1> 1,8293987,23 would yield a match <1> the idlist is varchar? <6> but yes it hmmm might not be the smartest way <6> when i think of it <6> i tried to make a shortcut. I want to return all items in sub-items from a hieraky-tree. And to loop recursive seemed slow <1> use this: WHERE charindex(',' + @me_id + ',',',' + dbo.eshop_menuurl.meurl_idlist + ',') > 0) <6> and since the idlist is containing a list of all its parents i though this might work <6> df: what is that? dont follow the logic <1> you have an idlist which is denormalizing parent id's <6> mmm <1> 1,12,57,8 <6> yes <1> its a string
<6> yes <1> you want to match an input var (string) to that list, but have to treat it like a list <6> hmm <1> so if you p*** 1, you want a match on the first item, not on the first and second <6> true.. 1 != 10 <6> so yout charindex will handle this? <6> let me try! <1> so, you take @me_id, which we say is 1, and you add a comma to the front and back of it: ,1, then you take your list, and add a comma to the front and back of it: ,1,12,57,8, <1> and you try to match the first string to the second, removing ambiguity with 'partial' matches <1> charindex is similar to like in some sense <1> this is the poor man's 'list handling' <6> will it handle the partial matches now as well? i hate it when i dont understand what i paste into my code :) <1> read my explanation and why it will never do partial matches <1> ,1, = ,1, it doesn't equal ,12, <6> okay so what you say is this will never work? <1> huh? <1> of course it will work <6> sorry i need time to think :) <1> i'll go get cigarettes while you do <6> cool <6> maaan this is ODD <6> df: this one works as you say: http://sql-servers.com/nopaste/?show=263 <6> But still, if i replace the searchstring with a @var it fails <7> anyone buy any small (2-3tb) iSCSI > sata storage units lately? <8> ioNix_, i don't know what to tell you then since i use the code i gave you extensively <6> yes the code seem to word <6> work <6> the problem it in the variable-handling <6> as soon as i replace the searchstring with a @variable it fails <6> i guess its a very simple syntax thing? <1> i would imagine <6> check this line out: (charindex(';'+@me_id+';',';' + dbo.eshop_menuurl.meurl_idlist + ';') > 0) <6> looks alright? <6> and @me_id is a varchar <1> yes <1> i ***ume meurl_idlist is a varchar as well and that you're p***ing in the value as a string <6> arghghg... gaaaaaah <6> (charindex(';8230;',';' + dbo.eshop_menuurl.meurl_idlist + ';') > 0) <--- this works perfectly <6> i need to curse at something! <9> CURES U DAMNT ALL TO HELL AND BACK SITHSPAWN <6> thanks <9> np <10> I'm using DB2 and I need to construct a query to return rows correlated to a UNION product. Could anyone give me some pointers on how to construct this? When I try to use WHERE ordernum IN (SELECT... UNION SELECT...) it tells me UNION is not valid. I'm trying to use HAVING, but I've never had much luck with it. :P <11> db2 on what machine? <1> having is for group by queries <11> theres the mainframe version and then theres the unix version <1> is your union unioning only a single column? <11> they are very different <10> DB2 on an iSeries <10> the UNION is returning a single column <11> paste the whole query on the paste site <10> okay, working on it <12> SELECT * FROM Table1 WHERE ID IN (SELECT ID FROM Table2 UNION SELECT ID FROM Table3); <-- something to that effect? <10> halo yeah <10> here it is: http://sql-servers.com/nopaste/?show=264 <12> What's with the #s? Those actually a part of the column names? <11> you can replace the whole where in (...) clause with an or <13> Why are you unioning to the same table 3 times instead of just using an or in the where? <10> halo yeah <10> Drk`Angel: it was what I came up with that returned the rows I needed :P <11> try an or <12> Nix the ()s around the subselects <13> Try the or. It'll be faster, and you won't have the problem with union bitching at you. <12> But yeah, refactor with ORs or IN () <10> ah, I remember now... I need to return order numbers that only have all three item numbers ***ociated with them <11> union = or <10> oh, okay <13> union is or anyways, so this isn't doing that already. <11> so if you do an union you will get teh same result as an or only takes longer <10> interesting... <13> well, union is or in this context, rather. <12> INTERSECT would work, wouldn't it? <13> Yeah <13> You beat me to it.
Return to
#sql or Go to some related
logs:
visio csharp CHKDSK is verifying indexes #politics #debian #linux-noob #nhl sendto in send_ip_packet: sendto => Operation not permitted #politics #gentoo #windowsxp
|
|