Help on sql statement (not MySQL specifik)

2006-03-05 Thread Søren Merser
Hi Could someone please help me out here? TABLE: RECNO| ID |TYPE - 1| 1|NULL 2| 2|4-KEEP AS IS 3| 2|6- DROP 4| 3

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Rhino
- Original Message - From: Søren Merser [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Sunday, March 05, 2006 9:12 AM Subject: Help on sql statement (not MySQL specifik) Hi Could someone please help me out here? TABLE: RECNO| ID |TYPE

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Ronald J. Yacketta
I think he wants to update rows where != 4 to null that is, update TYPE setting TYPE to null where TYPE != 4 -Ron Rhino wrote: - Original Message - From: Søren Merser [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Sunday, March 05, 2006 9:12 AM Subject: Help on sql statement

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Søren Merser
Hi, I'll try I need one record for each id in the tabel, i.e. NO duplicate id's with TYPE set to 4 or NULL Now, the TYPE of id 2 is 4 so I peserve it; As id 2 has more than one entry I have to delete it/them Id's with TYPE = NULL (id 1,4,5)is kept Id 5 (and 6) has two records, none of which

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Michael Stassen
Søren Merser wrote: Hi, I'll try I need one record for each id in the tabel, i.e. NO duplicate id's with TYPE set to 4 or NULL Now, the TYPE of id 2 is 4 so I peserve it; As id 2 has more than one entry I have to delete it/them Id's with TYPE = NULL (id 1,4,5)is kept Id 5 (and 6) has two

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Rhino
that if the value of the type is 4, leave it alone, otherwise display null. -- Rhino - Original Message - From: Søren Merser [EMAIL PROTECTED] To: mysql@lists.mysql.com; Rhino [EMAIL PROTECTED] Sent: Sunday, March 05, 2006 11:46 AM Subject: Re: Help on sql statement (not MySQL specifik

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Rhino
- Original Message - From: Michael Stassen [EMAIL PROTECTED] To: Søren Merser [EMAIL PROTECTED] Cc: mysql@lists.mysql.com Sent: Sunday, March 05, 2006 1:13 PM Subject: Re: Help on sql statement (not MySQL specifik) Søren Merser wrote: Hi, I'll try I need one record for each id

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Michael Stassen
Rhino wrote: I don't really understand _why_ you want to do this but here is a query that gives the result you want: select id, case type when 4 then 4 else null end as type from Soren01 group by id; The GROUP BY ensures that you get one row for each value of id; the case expression in the

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Rhino
to start with. In any case, thanks for keeping me honest. -- Rhino - Original Message - From: Michael Stassen [EMAIL PROTECTED] To: Rhino [EMAIL PROTECTED] Cc: Søren Merser [EMAIL PROTECTED]; mysql@lists.mysql.com Sent: Sunday, March 05, 2006 2:26 PM Subject: Re: Help on sql statement

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Søren Merser
: Søren Merser [EMAIL PROTECTED]; mysql@lists.mysql.com Sent: Sunday, March 05, 2006 9:05 PM Subject: Re: Help on sql statement (not MySQL specifik) You're absolutely right that I'd need some good luck for this query to work for every possible data value that the table could continue. I realized

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Rhino
: Help on sql statement (not MySQL specifik) Hi Thank You for all Your efforts I'll try once again to clarify my problem My tabel (t_temp) isn't corrupt but is the result form a join from two other tables 1) t_base, with id's and basic info of patients. 2) t_events. with id (of the patient

Help with SQL statement?

2003-01-15 Thread Jeff Snoxell
Hi, I've got a varchar field in a mysql table that contains 'N' numbers (each a maximum of 4 digits, not zero padded) separated by spaces when more than 1 number is present. eg. field content might be any of the following '' '123 4567 1234 45 3' '3' '3 4 6' I want to select only those

Re: Help with SQL statement?

2003-01-15 Thread Csongor Fagyal
Jeff Snoxell wrote: Hi, I've got a varchar field in a mysql table that contains 'N' numbers (each a maximum of 4 digits, not zero padded) separated by spaces when more than 1 number is present. eg. field content might be any of the following '' '123 4567 1234 45 3' '3' '3 4 6' I want to

Re: Help with SQL statement?

2003-01-15 Thread Paul DuBois
At 16:40 + 1/15/03, Jeff Snoxell wrote: Hi, I've got a varchar field in a mysql table that contains 'N' numbers (each a maximum of 4 digits, not zero padded) separated by spaces when more than 1 number is present. eg. field content might be any of the following '' '123 4567 1234 45 3'

Re: Help with SQL statement?

2003-01-15 Thread Salam Baker Shanawa
Try this: SELECT * FROM MyTable WHERE RefList not regexp (^|[^0-9])MyNum([^0-9]|$); Regards Salam Jeff Snoxell wrote: Hi, I've got a varchar field in a mysql table that contains 'N' numbers (each a maximum of 4 digits, not zero padded) separated by spaces when more than 1 number is

Help on SQL Statement

2001-10-31 Thread Mike Mike
Hello, I've been working on this for a long time now and I cannot figure this out. Can someone help me get this sql statement without erroring or why it doens't work. Here is the SQL statement... SELECT DISTINCT ItemMaster.ParentNum, ItemMaster.Desc1, ItemMaster.Price FROM BillOfMat AS

Help on SQL Statement

2001-10-31 Thread Christopher Book
You can't use brackets on left joins like that. If you want to do two left joins, you use: LEFT JOIN table1 ON conds LEFT JOIN table2 ON conds That's why you're getting the error that mysql displayed, it doesn't expect a bracket. Chris SELECT DISTINCT ItemMaster.ParentNum, ItemMaster.Desc1,

RE: Help on SQL Statement

2001-10-31 Thread Rick Emery
embedded joins -Original Message- From: Mike Mike [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 11:24 AM To: [EMAIL PROTECTED] Subject: Help on SQL Statement Hello, I've been working on this for a long time now and I cannot figure this out. Can someone help me get this sql

Re: Help with SQL statement please.

2001-02-09 Thread Bob Hall
I hope somebody may of come across this sort of problem before dealing with counting total records in subcategories. I have two tables sslinks which contains links (URL) information and sslinkcats which contains category information. The category table "sslinkcats" has a field called "lcat_id"

Re: Help with SQL statement please.

2001-02-08 Thread Phil Latio
I see, I need a recursive algorithm Can you get them in Woolworths? - Original Message - From: "Tommie Jones" [EMAIL PROTECTED] To: "Phil Latio" [EMAIL PROTECTED] Cc: Sent: Thursday, February 08, 2001 12:18 PM Subject: Re: Help with SQL statement please. If

Re: Help with SQL statement please.

2001-02-08 Thread Rolf Hopkins
- From: "Phil Latio" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 08, 2001 20:52 Subject: Re: Help with SQL statement please. I see, I need a recursive algorithm Can you get them in Woolworths? - Original Message - From: "Tommie Jones&qu

HELP with SQL statement

2001-01-19 Thread Mike Podlesny
I have a table called RATING and two fields one called POSITIVE and the other called NEGATIVE. I need to write an SQL statement for my mySQL database that will return the value of the total of POSITIVEs minues the total of the NEGATIVEs. Any ideas?

HELP with SQL statement

2001-01-19 Thread Mike Podlesny
the number 3's (negatives) to give me a true rating. Any ideas? - Original Message - From: "Tomi Junnila" [EMAIL PROTECTED] To: "mySQL Mailing List" [EMAIL PROTECTED] Sent: Friday, January 19, 2001 10:32 AM Subject: Re: HELP with SQL statement * Mike Podlesny [EM

Re: HELP with SQL statement

2001-01-19 Thread Tomi Junnila
* Mike Podlesny [EMAIL PROTECTED] wrote on 19.01.01 17:52: Actually let me reword this because Tomi's answer won't quite work. The table has a field called Rating. A number 1 is stored to represent positive a 2 is stored for neutral and a 3 is stored for negative. I need to query that will

Re: HELP with SQL statement

2001-01-19 Thread Milo Stefani
r 1's (positives) and subtract all the number 3's (negatives) to give me a true rating. Any ideas? - Original Message - From: "Tomi Junnila" [EMAIL PROTECTED] To: "mySQL Mailing List" [EMAIL PROTECTED] Sent: Friday, January 19, 2001 10:32 AM Subject: Re: HE