RE: Can someone explain???? strange query!! THANKS!!

2005-04-29 Thread nngau
Ahh okay the column was cut off or something \G shows it!

Thanks!!



-Original Message-
From: Rich Lafferty [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 29, 2005 10:28 AM
To: mysql@lists.mysql.com
Subject: Re: Can someone explain strange query!!

On Fri, Apr 29, 2005 at 10:46:16AM -0500, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> I did two query, can someone explain what happened?

Not with what you included:

> | customer_num | title | first_name | middle_name | last_name | email
|
> dayphone | evenphone | address1 | Address2 | address3
|
> address4 | city  | state_province | country | CompanyName | pkey
> | zipcode | bldgID |

19 columns.

>  | NULL | NULL | NULL | Tempe | Arizona| USA |
> NULL| D5BC55546AC74547EE497D4F559607DF | 85281   | NULL   |

10 columns, presumably the line with "address" and "zipcode", not
the line with "first_name" and so forth.

> How did it find that row when the fields are NULL?

I believe it isn't. Do the query with "\G" instead of ";" on the
end so that you see what values are in which columns.

  -Rich

-- 
Rich Lafferty
--+---
 Ottawa, Ontario, Canada|  Save the Pacific Northwest Tree Octopus!
 http://www.lafferty.ca/|http://zapatopi.net/treeoctopus.html
[EMAIL PROTECTED]
---+---

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Can someone explain???? strange query!!

2005-04-29 Thread Rich Lafferty
On Fri, Apr 29, 2005 at 10:46:16AM -0500, [EMAIL PROTECTED] <[EMAIL PROTECTED]> 
wrote:
> I did two query, can someone explain what happened?

Not with what you included:

> | customer_num | title | first_name | middle_name | last_name | email |
> dayphone | evenphone | address1 | Address2 | address3 |
> address4 | city  | state_province | country | CompanyName | pkey
> | zipcode | bldgID |

19 columns.

>  | NULL | NULL | NULL | Tempe | Arizona| USA |
> NULL| D5BC55546AC74547EE497D4F559607DF | 85281   | NULL   |

10 columns, presumably the line with "address" and "zipcode", not
the line with "first_name" and so forth.

> How did it find that row when the fields are NULL?

I believe it isn't. Do the query with "\G" instead of ";" on the
end so that you see what values are in which columns.

  -Rich

-- 
Rich Lafferty --+---
 Ottawa, Ontario, Canada|  Save the Pacific Northwest Tree Octopus!
 http://www.lafferty.ca/|http://zapatopi.net/treeoctopus.html
[EMAIL PROTECTED] ---+---

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Can someone explain???? strange query!!

2005-04-29 Thread Jay Blanchard
[snip]
I did two query, can someone explain what happened?

First query:

mysql> select * from customer_billing where first_name="shad";

mysql> select first_name, customer_num from customer_billing where
first_name="shad";

Now these query is the same except for the '*'? 
[/snip]

http://dev.mysql.com/doc/mysql/en/string-syntax.html

What happens if you try this...

select * from customer_billing where first_name='shad'

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]