| |
| |
| |
|
Page: 1 2 3 4 5
Comments:
<0> right, but if a billiard match consists of 2 players. I mean i still dont get it. <0> how do query for what i want done <1> hahaha <2> ifreezeu: you have it built wrong <0> that specific table ? <0> MatchScore <2> eh whatever.. <0> i bet the whole design :) <2> yes the whole design probably <2> but im not gonna try to fix that <2> what exactly do you wnat/ <0> to find out all subtotals for all players <0> like sum of all fileds <2> you would have to do it on each column and then do another group by aftewards or something <2> or just do it programmatically <0> i want the group by to work in a way , if player1 is member or player2 is member
<0> yes you right , thats what i thought <3> mssql... i have this excel spreadsheet with like 17 sheets on it all corresponding directly tables in my db <4> using mssql, i have a field with values of either "rank1", "rank2", "rank3", "rank4" <4> what's the easiest way to return the rows in this order: <4> rank1, rank3, rank2, rank4 <3> tapped add a new column "order" and order by that <4> ok <3> i'm using DTS to import the xls... but so far i think the only way to do it is to set up a separate connection for each table... is there an easier way? <5> order by case rank when 'rank1' then 1 when 'rank3' then 2. .. etc <4> thanks <6> tapped do you have a rank10? <4> huh? <6> let me rephrase that <6> <6> tapped do you have a 'rank10'? <4> haha <4> no just up to 4 <6> i wonder if it would be faster to just get the last character on the right <6> and order by that <4> hmm <4> possibly <3> he wants it out of order <6> oh <6> i didnt see that <4> order by case right(rank,1)... <6> still might be faster to compare the last character out of order <6> run some statistics on it and let me know <4> ya, definitely <4> thanks <7> using ADO, how do I limit the record sets results ? <2> Kem0: do it using sql <2> since you are in #sql <8> how to do a iif in mssql? <9> What is the best way to have people log into a site using an sql database and php if SSL is not an option? Anyone have any idea how sites like myspace and friendster handle logins? <10> samlander : case <8> YuppieGTW: thanks <10> samlander : or, if you're testing for nulls, use isnull() or coalesce() <8> testing a bit field for 0 or 1 to output a status of 'Paid' vs 'unpaid" <8> iif (isPending = '1', 'Unpaid', 'Paid') as 'Status' <8> <- pseudo <10> samlander : then use case <2> mvsmith: too general a question and i dont think friendster and myspace have their code out for everyonen to see <10> mvsmith : they just don't use ssl <10> so the uid/pwd travels in clear <10> mvsmith : turn this on it's head - what is so important that you need to encrypt the uid/pwd but isn't important enough to use ssl? <11> whats a better way to do this statement: DELETE FROM #poheader WHERE databasecode + ponumber NOT IN (SELECT databasecode + ponumber FROM #pomaster) <10> [Optikal] : 'better' in what sense? <11> faster <11> there must be a way to do a better join <11> than concatenating the 2 strings <12> perhaps something at design time. ;) <10> why 'must'? <10> they're both temp table, so will probably be cached <10> populating a field with the total when they're created would make it a bit quicker <11> brb <11> its not a total <11> its basically 2 separate text fields <11> the primary key is a composite key <11> and I need to join between the 2 on that key <11> I'm not sure the 'proper' way to do it <9> i wanted to know how regularly used sites handle logins - if there was a special way to do it. all i'm planning to do is take in a user name and p***word using sha1 in php and check it against a database. <11> so I was just concatenating the 2 fields together into one so I could use it with an IN clause
<10> [Optikal] : that's not so good <11> yuppie: I know <11> whats the better way to do it <10> as 'fred' + 'bert' == 'fre' + 'dbert' <11> how do I delete all records from one table that don't exist in some other <11> and the join between the 2 tables is using multiple fields <10> well, not having a primary key that is a composite of two strings is a start <11> what's wrong with that? <2> [13:46:11] <10> as 'fred' + 'bert' == 'fre' + 'dbert' <2> tahst wahts wrong wit it optical <10> what's wrong with having an identity int as the primary, and the combo as a unique <11> siclude: thats a problem with me concatenating them together, not with having a composite PK <2> but you dotn have a composite PK <2> you have a concatenated PK <11> yuppie: this is a legacy db <11> we can't change it <2> a better join would be: where a.x = b.x and a.y = b.y <11> siclude: no I don't <10> [Optikal] : # indicates a temp table <2> as opposed to: where a.x + a.y = b.x + b.y <11> siclude: that's exactly what I want to do, how do I do that in my DELETE statement <11> yuppie: its all originating from a legacy table <10> [Optikal] : delete can have two 'from' clauses <11> the temp table is just something we're using as a intermediate step <11> can somebody show me an example of how I would rewrite that delete statement? <10> second from is the join <10> [Optikal] : which rdbms? <11> sql 2005 <10> write is as a select first of all - select all the records you want to delete <10> then prepend with 'delete from table' <10> when the select works <13> magic :) <11> SELECT * FROM #poheader AS a LEFT OUTER JOIN #pomaster AS b ON a.databasecode = b.databasecode AND a.ponumber = b.ponumber WHERE b.ponumber IS NULL <11> something like that <2> YuppieGTW: if your select statemetn is: select .. from tabe1, table2 where ... <11> ? <2> optikal: try it :) <11> I don't know how to turn that into a delete?? <10> then prepend with 'delete from table' <11> but the SELECT * is taking all fields from both tables in the resultset <10> and remove 'select *' <11> how will the delete know which to use? <10> ffs!\ <11> oh... <10> delete from <table> <- <11> so like DELETE FROM #poheader AS a LEFT OUTER JOIN #pomaster AS b ON a.databasecode = b.databasecode AND a.ponumber = b.ponumber WHERE b.ponumber IS NULL <11> ? <10> yeah, that kind of thing - just like it's written in the documentation <11> I get an error <11> incorrect syntax near the keyword as <2> ugh <10> then take away the 'as' <2> delete from table1 from table1 join table2 on a = n <10> it's only used when aliasing fields, not tables <11> uhh, I use as to alias tables all the time... <10> [Optikal] : then the gods of sql must really hate you today <11> I think I'm getting somewhere, hold on a sec <2> optikal: dude look at the example I just wrote <3> (mssql) i am using truncate table, but it says it can't do it because of a FK ... except this table and the foreign table are both already empty! <3> why would it say this <14> hello <11> siclude: yeah, thats what's getting me somewhere <11> just checking if its deleting the right records...gimme as ec <10> tenfour : paste the 'exact' error <3> Cannot truncate table 'ReviewFormObjectives' because it is being referenced by a FOREIGN KEY constraint. <3> there is only 1 table that references it, and it has 0 rows <15> disable the FK <15> maybe <14> how can I make a select statement whose where clause makes sure one field is set to something, and then another field is set to either "1" or "2" <14> ? <10> adamc : what a lame question <11> adam: AND <13> where col1 = 'blargh' and (col2 = 1 or col2= 2) <13> or
Return to
#sql or Go to some related
logs:
Election in venequela #linuxhelp #gamedev #red biowin exploit #solaris medion MD6471 driver #online #gamedev ozzyyyyy
|
|