RE: more about using sets

2002-12-17 Thread Anderson, Alan R
> From: David T-G [mailto:[EMAIL PROTECTED]]
> ...I still have to figure
> out how to make sure that our credit card types and skill levels don't
> get corrupted (MC, MasterCard, mastercard, ...), but I guess that gets
> enforced in the software interface, right?

Isn't the card type a piece of derived data?  You should never have to enter it 
directly; it's computable from (the first digit(s) of) the card number.

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: ADO Bulk Inserts

2002-12-11 Thread Anderson, Alan R
> From: Michael She [mailto:[EMAIL PROTECTED]]
> ...So are you saying that the Windows ODBC MySQL driver 
> doesn't support multiple statements?

So far as I know, *no* drivers support multiple statements.

However, that's not what you want for "bulk inserts".  What you want is multiple value 
sets in one INSERT statement:

  INSERT INTO tablename(col1, col2) VALUES (val1a, val2a), (val1b, val2b), (val1c, 
val2c)

That's what you're doing already, right?  So I don't understand your issue.

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Desc question

2002-12-09 Thread Anderson, Alan R
> From: Alex Behrens [mailto:[EMAIL PROTECTED]]
> ...How can I make it so only one form
> selection adds a DESC tag to the query, is this possible?
> 
> I'm using this code:
> 
> $fetch = mysql_query("SELECT * FROM players ORDER BY $var");
> 
> 
> Name
> Position
> Number
> Grade
> 
> I want only the Grade option to use the desc option with the 
> $fetch query.

If you want DESC to go along with grade_num, just put DESC with grade_num:

  Grade

This seems obvious to me, so I must be missing something. :-)

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Can someone explain this?

2002-12-06 Thread Anderson, Alan R
> mysql> select sum(trial_signups) from campaign_t where 
> datestamp='20021204'\g
> ++
> | sum(trial_signups) |
> ++
> |100 |
> ++
> 
> 
> mysql> SELECT site_id, sum(raws) As RawHits, sum(uniques) As 
> UniqueHits,
> sum(trial_signups) As Sales FROM campaign_t WHERE datestamp >=
> '20021204' AND datestamp <= '20021204' GROUP BY site_id\g
> +-+-++---+
> | site_id | RawHits | UniqueHits | Sales |
> +-+-++---+
> |   1 |6231 |   3672 | 1 |
> |   2 | 143 | 96 | 0 |
> |   3 | 256 |128 | 0 |
> |   4 |  16 | 11 | 0 |
> |   6 |   9 |  9 | 0 |
> |   7 |  88 | 45 | 2 |
> |   8 |1801 |   1055 |11 |
> |   9 |2805 |   1979 | 2 |
> |  10 |2251 |669 | 0 |
> +-+-++---+
> 
> It's JUST the date '20021204'.. the rest of the dates (for the past 4
> months) have been working fine.
> 
> Any ideas?

Only one:  Are there any NULL values in the site_id column for that date?

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: load data infile syntax

2002-11-07 Thread Anderson, Alan R
>If the data contains "\", then database will automatically takes "\" 
>away and shift 1 byte left.
>My data will mass up. That is why I still need "\"

Does your data actually include backslash characters?  If you want to import them as 
they are, you definitely don't want to ESCAPE BY them.

Escaping is used to treat otherwise special characters as nonspecial.  For example, 
quotes and commas have special meaning in some text files, but you can 'escape' the 
special interpretation by using a scheme like prefixing them with a character that's 
"more special" than they are.  The prefix is usually a backslash, which means that if 
you really do want a backslash, you need to use two of them (the first one says to 
treat the next character in a different way than usual).

So the moral of the story is this:  If you're trying to import backslashes into an SQL 
table, and your text file doesn't have backslashes doubled, don't choose a backslash 
as your ESCAPE BY character.

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: update question

2002-11-01 Thread Anderson, Alan R
> -Original Message-
> From: Jörgen Winqvist [mailto:jorgen@;winqvist.net]
>
> I need to let the values in two columns change place with each other. 
> I've tried to "update xxx set a=b, b=a" but that doesn't work 
> (b=a uses 
> the "new" a).

Here's a cute trick for swapping two numbers without using a temporary variable:

  set a=a-b, b=b+a, a=b-a

I don't know how applicable it is to your query, but it might be worth considering.

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Need a little query help

2002-10-29 Thread Anderson, Alan R

> -Original Message-
> From: Chris Mason [mailto:masonc@;masonc.com]
> [...]
> The problem is, it is easy to test for one amenity, but I need to test
> that the hotel has all of the amenities. The query above 
> returns all the
> hotels that have ANY of the amenities, I need the hotels having ALL of
> the amenties only.

Try turning the problem around.  Instead of including only the hotels having all 
desired amenities, you might get the results you want by excluding any hotels 
_lacking_ a desired amenity.

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php