Alternate forms of given name, lookup table

2006-04-26 Thread 2wsxdr5

Does anyone know where I mind find a table to look up alternate forms of
a certain given name?  For example; if I give it Bob it gives me Robert
and if I give it Bill it gives me Will and William.  Or if I give it
either Dick, Rick or Richard it gives me back the other two.  Also, once
I have this lookup table and I am trying get Bob in my table A to match
with Robert in my table B what would the query look like.  Just to start
here is kind of what I have been doing so far...

SELECT a.FName a.MName, a.LName, a.Street, a.City, a.State, a.ZIP, a.Phone
FROM TableA as a, TableB as b
WHERE a.LName  = b.LName AND  LEFT(a.MName, 1) = b.MInitial AND a.ZIP =
b.ZIP
## the following will match names like Chris and Christopher.  I need to
replace this with something better.
(
(b.FName like concat(a.FName, '%') AND a.FName = a.FName) OR
(a.FName like concat(b.FName, '%') AND b.FName = b.FName)
)
ORDER BY a.LName, a.FName

--
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want &
give the gifts they want
One stop wish list for any gift,
from anywhere, for any occasion!
http://thewishzone.com



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



Re: exporting a mysql database via mysql query browser

2006-04-24 Thread 2wsxdr5

[EMAIL PROTECTED] wrote:


I am a phpmyadmin user and have never really used mysql query browser before. I 
have a database sitting on my localhost and I want to export the whole thing 
via mysql query browser to the host. What is the easiest way to do it?

Ross
 

Use the MySQL admin tool, not the query browser.  Look at the back 
options in the admin tool


--
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want
One stop wish list for any gift, 
from anywhere, for any occasion!

http://thewishzone.com


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



Re: Working out Square Footage with Feet and Inches

2006-04-21 Thread 2wsxdr5

Shaun wrote:


I have stored the dimensions as decimal(4,2), does this make a difference?
 



not a very good way to do it if you ask me but here is how to do the 
calculation.


SELECT ((FLOOR(X) + ((X - FLOOR(X))/0.12)) * (FLOOR(Y) + ((Y - 
FLOOR(Y))/0.12))) as SqFt.


FLOOR(X) gives you 6 from the 6.11
X - FLOOR(X) gives you the .11 part
.11/.12 gives you the appropriate fraction of a foot.to add back to X 
then the same thing for Y and multiply.


--
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want
One stop wish list for any gift, 
from anywhere, for any occasion!

http://thewishzone.com


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



Real Solution to ReplyTo problem

2006-04-20 Thread 2wsxdr5

As many have pointed out, the arguments on both sides of the mailing
list ReplyTo behavior have serious flaws.  There is a good reason for
that.  Both arguments are week and use a lot of spin, in a futile
attempt to make their solution appear to be the ideal one.  In reality,
both solutions are bad, but for different reasons.  A good solution
would be for a mailing list to, instead of modifying any headers, add a
ListReply header that would point to the list address.  Then the email
clients can be configurable on how they deal with messages that have
this header.  The default to obviously reply to the list.

I don't see either as all that bad, but it is a pain when most all of
the lists you use are one way, and then this one is the other way, which
is the way it is for me.  It's hard to get in a habit of using the Reply
to All option when replying to this list, which I don't do very often,
is the only time I need to do that.  On top of that the person who sent
the post I am replying to gets 2 copies of the message, as if we all
don't have enough mail to delete.

--
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want &
give the gifts they want
One stop wish list for any gift,
from anywhere, for any occasion!
http://thewishzone.com

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



Re: Social Network, linking members

2006-04-07 Thread 2wsxdr5

Martin Gallagher wrote:


Hi,

I'm trying to find the most efficient way of "linking" members to one
another in a social networking application.

Currently I link them using 2 separate fields for the members: id1, id2. So,
to find people in your network you would do:

I'm not sure exactly what it is you are doing but I think this may be 
it.  You have a table of people and you want to know who is friends with 
who.  I know 'friend' may not be the best term to use but it is easier 
to type.  So I have my people table.


People{
 *PID,
 Name,
. . .
}

Then the Friend Table,

Friend{
*PID,
*FID
}

If you have person, John, with ID 234, and you want to know all his 
friends you can do this...

SELECT  f.FID, p.Name
FROM Friend f JOIN People p ON f.FID = p.PID
WHERE f.PID = 234

of course you have the problem where john has Joe as a friend but Joe 
doesn't have john as a friend.  This seeming inconsistency, may or may 
not be a problem depending on exactly what kind of a relationship you 
are trying to define. 


--
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want
One stop wish list for any gift, 
from anywhere, for any occasion!

http://thewishzone.com


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



On Duplicate Key....

2006-04-04 Thread 2wsxdr5
I want an On Duplicate Key do nothing feature which obviously doesn't 
exist.  However, will this be any faster than actually updating the row. 


INSERT INTO table (a,b) VALUES (1,2)
ON DUPLICATE KEY UPDATE b=b;


BTW each row is made up of only 2 columns and those to columns make up 
the key so if there is a duplicate key the record I am trying to insert 
is already there exactly as I am attempting to insert



--
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want
One stop wish list for any gift, 
from anywhere, for any occasion!

http://thewishzone.com


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



dumping results of a select

2006-03-02 Thread 2wsxdr5
Is there a way with mysqldump to instead of dumping the contents of a 
table dump the contents of a select so if you import that sql back in 
you will get a new table that looks like the select?


--
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want
One stop wish list for any gift, 
from anywhere, for any occasion!

http://thewishzone.com


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



returning empty columns

2006-02-28 Thread 2wsxdr5
This is probably going to sound like an odd request, but is there a way 
to return empty columns in Mysql.  For example a roll call sheet I want 
to do a select of names from my table and then add a column for each  of 
the next 12 weeks.  I tried this.


SELECT `Call`, concat(FName, ' ', LName) as Name, 'Mar-6' ,'Mar-13', 
'Mar-20', 'Mar-27'

FROM table
Order BY LName, FName

The problem is it put that date on every row and I just want the names 
to show up in the column header  I know I could just write some php code 
to print out a table with the columns but I have a handy php function 
the prints the out put of a query in a table already so if I can find 
the right query I don't have to change that code any.


--
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want
One stop wish list for any gift, 
from anywhere, for any occasion!

http://thewishzone.com


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



Re: General Questions regarding mysql and php

2006-01-08 Thread 2wsxdr5

Andrew Burrows wrote:


Hi MYSQL users,

Just started playing with mysql apache php and other tricky stuff and have a
few question to get me going after many years.

Was wondering what the best GUI based administration tool is used today, I
lasted used phpMyAdmin, is this still used or are there better applications
available?
 



If you don't have remote access to the port MySQL is running on, 
phpMyAdmin is still very good.  However, when ever I can, I use the 
mysql GUI tools, MySQL Query Browser and MySQLAdmin.  They are both 
written by MySQL and are on the site for download.

http://dev.mysql.com/downloads/


Looking for some basic documentation on MYSQL could someone recommend
something online or maybe a book??
 

MySQL maintains a manual for each of the major version online in several 
formats, including HTML and PDF,  I prefer the US - Letter size PDF 
file.  It is over 1,700 pages of information.  Most anything you need to 
know about it can be found in there. 
http://dev.mysql.com/doc/




I have an old system that will probably need upgrading.

Apache 1.3
Mysql 3.22.32
Tomcat 3.1.1
Red Hat 8

Would you recommend upgrading this system or starting from scratch?
 



Well if you want to go all the way to MySQL 5, you will need to do 
several upgrades.  I would just start over with a modern Linux 
Distribution that has MySQL 4.1 Apache 2 and I think PHP 5.  It will 
take far less effort than upgrading what you have now.


--
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want
One stop wish list for any gift, 
from anywhere, for any occasion!

http://thewishzone.com


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



query with vars

2006-01-07 Thread 2wsxdr5
I have two independently built tables of people.  I am trying to match 
people from one with people from the other.  The problem is that in one 
table they may have used "Ron" and in the other "Ronald".  What I want 
to do is have a match if on something like "if 'Ronald" is like 'Ron%'  
but obviously for any name that could appear.  I know this won't help in 
cases like Bill and William but it's better than nothing.  The first 
query below is the one I thought would do the trick and the second one 
is setup for the specific case I know exists to test the general idea.  
The second one works but isn't very useful.  Can someone tell me how to 
make the first one work? 

The example I have has 'Ron' in the 'h' table and 'Ronald' in the 'm' 
table.  With a last name of Gibson.  In general the short name could be 
in either table.



This runs but I get no results.

SELECT (@hname:=h.FName) as hFName, (@mname:=m.FName) as mFName, 
m.LName, m.Phone

FROM m, h
WHERE m.LName = h.LName AND
(
  (h.FName like concat(@mname, '%') AND m.FName = @mname)
OR (m.FName like concat(@hname, '%') AND h.FName = @hname)
)


SELECT `Call`, (@hname:=h.FName) as hFName, (@mname:=m.FName) as mFName,
m.LName, m.Street1, m.Phone
FROM m, h
WHERE h.LName = 'Gibson' AND m.LName = h.LName AND
(
OR (m.FName like 'Ron%' AND h.FName = 'Ron')
)





--
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want
One stop wish list for any gift, 
from anywhere, for any occasion!

http://thewishzone.com


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



Re: phpmyadmin problems with quoting exported text

2005-11-06 Thread 2wsxdr5

John Taylor-Johnston wrote:

Which version? Which export type? Strings TEXT, VARCHAR would be 
quoted. INT would not, I think.

Their forum might be a better place. www.phpmyadmin.net.

I am using phpMyAdmin 2.6.1-rc.  I have no control over that as I am not 
the admin on the server.  All the columns I am talking about are 
varchar.  Some get quoted and some do not.  Also some integer columns 
get quoted for some reason I am unaware of.  With out quoting the 
strings it makes the output worthless.




--
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want
One stop wish list for any gift, 
from anywhere, for any occasion!

http://thewishzone.com


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



phpmyadmin problems with quoting exported text

2005-11-06 Thread 2wsxdr5

I just tried to use the output of the export function on phpmyadmin and
got a million errors.  After looking at the file I found that certain
columns that are strings were not quoted at all.  I can't find any
reason why some are and some are not quoted.  Anyone have any idea why
this is happening?

--
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want &
give the gifts they want
One stop wish list for any gift,
from anywhere, for any occasion!
http://thewishzone.com

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



Re: strange order by problem

2005-09-27 Thread 2wsxdr5

[EMAIL PROTECTED] wrote:


Claire Lee <[EMAIL PROTECTED]> wrote on 09/27/2005 03:48:11 PM:

 


I need to order a few names by the number following
the main name. For example swap2, swap3, swap10 in the
order of swap2, swap3, swap10, not in swap10, swap2,
swap3 as it will happen when I do an order by.

So I came up with the following query:

mysql> select distinct secname, date from optresult
where secname like 'swap%' and date like '2005-09-2%'
order by if (secname like 'swap%',(right(secname,lengt
h(secname)-locate('p',secname))+0), secname);

I was hoping it will order by the number following
each 'swap' in the secname, it doesn't work. It was
ordered instead by secname.

+--++
| secname  | date   |
+--++
| SWAP0.25 | 2005-09-21 |
| SWAP0.5  | 2005-09-21 |
| SWAP1| 2005-09-21 |
| SWAP10   | 2005-09-26 |
| SWAP10   | 2005-09-23 |
| SWAP10   | 2005-09-21 |
| SWAP2| 2005-09-26 |
| SWAP2| 2005-09-23 |
| SWAP2| 2005-09-22 |
| SWAP2| 2005-09-21 |
| SWAP3| 2005-09-21 |
| SWAP3| 2005-09-26 |
| SWAP3| 2005-09-23 |
| SWAP3| 2005-09-22 |
| SWAP5| 2005-09-21 |
| SWAP5| 2005-09-26 |
| SWAP5| 2005-09-23 |
| SWAP5| 2005-09-22 |
+--++

However, if I replace the second expression in the if
statement by date, like the following, it's ordered by
date as I would expect.

mysql> select distinct secname, date from optresult
where secname like 'swap%' and date like '2005-09-2%'
order by if (secname like 'swap%',date, secname);
+--++
| secname  | date   |
+--++
| SWAP3| 2005-09-21 |
| SWAP0.5  | 2005-09-21 |
| SWAP5| 2005-09-21 |
| SWAP1| 2005-09-21 |
| SWAP10   | 2005-09-21 |
| SWAP2| 2005-09-21 |
| SWAP0.25 | 2005-09-21 |
| SWAP2| 2005-09-22 |
| SWAP3| 2005-09-22 |
| SWAP5| 2005-09-22 |
| SWAP10   | 2005-09-23 |
| SWAP2| 2005-09-23 |
| SWAP3| 2005-09-23 |
| SWAP5| 2005-09-23 |
| SWAP10   | 2005-09-26 |
| SWAP2| 2005-09-26 |
| SWAP3| 2005-09-26 |
| SWAP5| 2005-09-26 |
+--++


So I tried different combinations of the second and
third expressions in the if statement in the query,
the next one is the only one I can get it to order my
way, which is not what I wanted of course since I
don't want other secnames than swap% to order this
way.

mysql> select distinct secname, date from optresult
where secname like 'swap%' and date like '2005-09-2%'
order by if (secname like 'swap%',(right(secname, leng
th(secname)-locate('p', secname))+0),
right(secname,length(secname)-locate('p',secname))+0);
+--++
| secname  | date   |
+--++
| SWAP0.25 | 2005-09-21 |
| SWAP0.5  | 2005-09-21 |
| SWAP1| 2005-09-21 |
| SWAP2| 2005-09-22 |
| SWAP2| 2005-09-26 |
| SWAP2| 2005-09-21 |
| SWAP2| 2005-09-23 |
| SWAP3| 2005-09-22 |
| SWAP3| 2005-09-26 |
| SWAP3| 2005-09-21 |
| SWAP3| 2005-09-23 |
| SWAP5| 2005-09-23 |
| SWAP5| 2005-09-22 |
| SWAP5| 2005-09-26 |
| SWAP5| 2005-09-21 |
| SWAP10   | 2005-09-26 |
| SWAP10   | 2005-09-21 |
| SWAP10   | 2005-09-23 |
+--++

Can anyone see what problems I have in my query? I'm
really stuck here. Thanks.

Claire

   


So you want to sort by secname except when secname starts with 'SWAP'

ORDER BY secname
   , if (secname like 'swap%'
   ,(right(secname, length(secname)-locate('p', secname))+0)
   ,0)
   , date;

by giving every *other* entry a default second sort-by of 0, they end up 
all sorting according to secname then date. It's when secname starts with 
swap that you get the sub-sorting value according to the end of the 
string. Make sense?
 

If secname is like 'swap%', why are you then using locate to find the p 
when it has to be the 4th letter or secname wouldn't be like 'swap%'.  
Also if your first order by argument is secname how is the second 
argument going to do anything since swap10 and swap2 are different the 
first argument is all you need to uniquely identify them.


--
Chris W

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want
One stop wish list for any gift, 
from anywhere, for any occasion!

http://thewishzone.com


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



Re: [Off] How much time should this take?

2005-09-16 Thread 2wsxdr5

Wigs @Claw wrote:


Hi guys ,  sorry for responding if this message is a bit off topic!

Id have to say that you are assuming no glitches come into play with 
that response.


I just recently had to do a Red Hat install , with Apache , MySQL and 
the works.  The install of Redhat ran into some issues with drivers on 
the older hardware , and this caused an obscene amount of time to the 
process. 


That's why I said if you have a fast computer with *compatible* hardware"

And if you have *never* touched DNS , I doubt you would want to rely 
on a couple hours to figure it out and leave it. 



probably true but I wouldn't charge a client for the time it took me to 
figure out something I should know before I take the job unless they 
specifically know and accept that condition a head of time.


Testing time also adds to the figure , and I think its quite possible 
that if there were hiccups ,



Most hiccups can be avoided if you make sure you know exactly what 
hardware you have and make sure it  is compatible first.


and if this consultant did proper testing etc , it could be close to 
12. But you know the job more in depth than me.



Testing would add time but with the condition's I listed I still think 
it could be done in 6 hours.


--
Chris W

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want

http://thewishzone.com


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



Re: [Off] How much time should this take?

2005-09-16 Thread 2wsxdr5

Brian Dunning wrote:

I got a 12-hour invoice from a consultant who was tasked to do the  
following:


- Install a Red Hat machine from absolute scratch for PHP/MySQL/Apache

- Copy over some MySQL databases

- Have mod_rewrite working via htaccess, and have wildcard DNS

I'm a programmer, not a sys admin, I don't think this would take me more 
than 6 hours, maybe 8.  Even given that I have never set up mod_rewrite 
or DNS.  I think in 6 to 8 hours I could easily figure that part out.  I 
have copied many MySQL databases from machine to machine and that takes 
almost no time unless the db is huge and or the machines are slow.  If 
you have the Red Hat install disks, a fast computer with compatible 
hardware, and all the information I needed to complete the task, the 
install of Red Hat and the other software you want would take the 
longest time.   Unless I had to do this on location, and therefore 
couldn't work on other things, I would have a hard time charging for 
most of that time.  In my case though, I would be using that time to 
research how to config mod_rewrite and DNS.  I have to admit it may take 
me longer than I think to figure out DNS config.  However, if I already 
knew that part I say 4 or 5 hours tops.



--
Chris W

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want

http://thewishzone.com


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



Re: max Mysql database size

2005-09-14 Thread 2wsxdr5

Andrew stolarz wrote:


Hello Everyone,
Hopefully easy question,
What is the Max size of a MySQL server database?

 

The answer to that question depends more on your OS than mysql.  A quick 
search of the contents page of the documentation clearly list the 
limitations of this kind.


--
Chris W

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want

http://thewishzone.com


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



Re: True randominess

2005-08-04 Thread 2wsxdr5

Pat Adams wrote:


However, in answer to your question, there is no way to get TRUE
randomness in a computer system. Even cryptographically secure random
number generators can be predicted under absolutely identical
circumstances.
 



While technically that is true, there is a method that will give what I 
think is a very random number and is extremely unlikely to produce the 
same sequence.  What you do is seed the random number generator with an 
integer based on the system time.  Unless the random number is generated 
at the same time every day, you will have very random out put.  If it is 
done at the same time every day you can use the date as part of your 
seed.  Depending on the frequency at which these random numbers need to 
be generated, you may wish to use fractions of a second or just seconds.


There are also several places that you can get a reasonably random 
number for the seed from your machine.  The amount of free disk space, 
unless that doesn't change much on your machine.  The amount of free 
RAM, (up time mod cpu usage).  Any number of things could be used that 
are not very predictable, if at all.



--
Chris W

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want

http://thewishzone.com


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



Re: Hour counts

2005-07-28 Thread 2wsxdr5

Eric Bergen wrote:

This does make his code fall under the limitations of unix timestamps. 
In 30 years or so when we are all retired millionaires ;) some poor 
intern is going to have to figure out why the hour diff calculation is 
failing.



Long before then we will all be using 64 bit processors and a 64 bit
signed integer for the unix timestamps.  That will move the problem out
about 292 billion years :)

--
Chris W

Gift Giving Made Easy
Get the gifts you want &
give the gifts they want
http://thewishzone.com

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



SQL help

2005-06-25 Thread 2wsxdr5

Can someone tell me why this query works...
SELECT UserKey
FROM(
 SELECT UserKey, Count(GiftKey) Gifts
 FROM Gift
 Group BY UserKey
) GC
WHERE GC.Gifts >= 3



And this one doesn't?

SELECT UserKey, UserID,
FROM User
WHERE UserKey IN
(SELECT UserKey
 FROM(
   SELECT UserKey, Count(GiftKey) Gifts
   FROM Gift
   Group BY UserKey
 ) GC
 WHERE GC.Gifts >= 3
)


In case you need some back ground and want to know what I eventually 
want to get read on...


I have a DB of Users of my wish list site.  The tables I have are
User > info about the users   UserKey is the key
Gift  > list of gifts each user has on their wish list  foreign key 
is UserKey

Event  --->gift giving events for users.   foreign key is UserKey
Emails > email addresses users have sent a message to about their 
wish list. UserKey is the foreign key here too.


The relationship between user and the other 3 tables is a 1 to many.  I 
have the following query that I need to adjust some.


SELECT u.UserKey, UserID,
Count(distinct g.GiftKey) gifts, Count(distinct ev.EventKey) events, 
Count(distinct e.Email) Emails

FROM User u NATURAL LEFT JOIN Gift g
LEFT JOIN Emails e ON e.Userkey = u.UserKey
LEFT JOIN GiftGivingEvent ev ON ev.UserKey = u.UserKey
GROUP BY UserID

What I really want is only the users where the gifts count is > 3, the 
Event count is > 1, the Emails count  is > 5 and and only count emails 
if e.Verified is = 1


I am pretty sure I have to write code to do the last part with the 
emails but is there a way to do the part with the gift and event counts?


--
Chris W

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want

http://thewishzone.com


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



Re: Limit of 1000 rows?

2005-01-14 Thread 2wsxdr5
Steve Grosz wrote:
I had tried to load a group of records from a Excel spreadsheet, and 
for the most part it seems to have worked.

The problem is that I know there were more than 1000 rows of data to 
be input, and it stopped at 1000 exactly. 
I'm not 100% sure but this is what I think happened.  You imported data 
from Excel into MySQL then used the MySQLCC GUI to look at the data in 
the table.  MySQLCC only returns the first 1000 records when you view a 
table.  If you right click on the table name and select Open Table -> 
Return Limit, and then enter a number high enough to get all your 
records you will then see all of them.  If you want to know how many 
records you have in the table, after opening the table click on the SQL 
button and change,

SELECT *
FROM `table`
to
SELECT count(*)
FROM `table`
and you will get the total number of records.
If I'm wrong and you were taking data from MySQL and importing it to 
Excel, I don't know for sure what happened.

--
Chris W
Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want
http://thewishzone.com

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


Re: counting records in 2 tables using 1 query

2005-01-14 Thread 2wsxdr5
[EMAIL PROTECTED] wrote:
There may be other ways to get at the information you want. What is 
the purpose of your query?

Ok here are the details.  I have a wish list/gift registry site 
(thewishzone.com).  I have a table listing all the data on my users.  I 
also have a table listing all the gifts my users want.  Finally I have a 
table with gift giving events for the users.  What I need to know is how 
many events and how many gifts each user has in the database so I can 
make certain changes to the content of the main user page on my site.  
Right now I just use 2 queries but I would like to do it in one just to 
reduce the code some what. I have other uses for similar queries but 
this is the main reason.

Chris W

2wsxdr5 <[EMAIL PROTECTED]> wrote on 01/13/2005 01:57:31 PM:
> I have these 2 queries.
>
> SELECT count(*) gifts
> FROM   gift g
> WHERE g.this and g.that
>
> SELECT count(*) events
> FROM   events e
> WHERE e.this and e.the other thing
>
> is there a way to put these into one query.
>
> SELECT count(g.*) gifts, count(e.*)
> FROM gift g, event e
> WHERE . . . .
>
> so far nothing seems to be working
>
> --
> Chris W
>
> Gift Giving Made Easy
> Get the gifts you want & give the
> gifts they want this holiday season
> http://thewishzone.com
>
> "They that can give up essential liberty
> to obtain a little temporary safety
> deserve neither liberty nor safety."
> -- Benjamin Franklin, 1759 Historical Review of Pennsylvania
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
>

--
Chris W
Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want
http://thewishzone.com

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


counting records in 2 tables using 1 query

2005-01-13 Thread 2wsxdr5
I have these 2 queries.
SELECT count(*) gifts
FROM   gift g
WHERE g.this and g.that
SELECT count(*) events
FROM   events e
WHERE e.this and e.the other thing
is there a way to put these into one query.
SELECT count(g.*) gifts, count(e.*)
FROM gift g, event e
WHERE . . . .
so far nothing seems to be working
--
Chris W
Gift Giving Made Easy
Get the gifts you want & give the
gifts they want this holiday season
http://thewishzone.com
"They that can give up essential liberty
to obtain a little temporary safety
deserve neither liberty nor safety."
-- Benjamin Franklin, 1759 Historical Review of Pennsylvania
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]