Re: Query Help...

2015-10-22 Thread shawn l.green
On 10/22/2015 11:48 AM, Don Wieland wrote: On Oct 20, 2015, at 1:24 PM, shawn l.green wrote: Which release of MySQL are you using? Version 5.5.45-cll How many rows do you get if you remove the GROUP_CONCAT operator? We don't need to see the results. (sometimes it is a good idea to look

Re: Query Help...

2015-10-22 Thread Don Wieland
> On Oct 20, 2015, at 1:24 PM, shawn l.green wrote: > > Which release of MySQL are you using? Version 5.5.45-cll > How many rows do you get if you remove the GROUP_CONCAT operator? We don't > need to see the results. (sometimes it is a good idea to look at the raw, > unprocessed results) >

Re: Query Help...

2015-10-20 Thread shawn l.green
On 10/20/2015 1:54 PM, Don Wieland wrote: Hi all, Trying to get a query working: SELECT ht.*, CONCAT(o.first_name, " ", o.last_name) AS orphan, GROUP_CONCAT(DISTINCT hti.rec_code ORDER BY hti.rec_code ASC SEPARATOR ", ") AS alloc FROM hiv_transactions ht LEFT JOIN tk_orphans o ON ht.orphan

Re: Query Help...

2015-10-20 Thread Peter Brawley
On 2015-10-20 12:54 PM, Don Wieland wrote: Hi all, Trying to get a query working: SELECT ht.*, CONCAT(o.first_name, " ", o.last_name) AS orphan, GROUP_CONCAT(DISTINCT hti.rec_code ORDER BY hti.rec_code ASC SEPARATOR ", ") AS alloc FROM hiv_transactions ht LEFT JOIN tk_orphans o ON ht.orphan_

Query Help...

2015-10-20 Thread Don Wieland
Hi all, Trying to get a query working: SELECT ht.*, CONCAT(o.first_name, " ", o.last_name) AS orphan, GROUP_CONCAT(DISTINCT hti.rec_code ORDER BY hti.rec_code ASC SEPARATOR ", ") AS alloc FROM hiv_transactions ht LEFT JOIN tk_orphans o ON ht.orphan_id = o.orphan_id LEFT JOIN hiv_trans_it

Pivot Query Help

2013-11-04 Thread Jan Steinman
I'm using MySQL 5.0.92-log. I'm trying to do a pivot-sort-of-thing. I've tried a few things from the O'Reilly "SQL Cookbook," but I seem to be having a mental block. I have a table of farm harvests. Each harvest has a date, quantity, and foreign keys into product and harvester tables: -

Query Help

2013-04-19 Thread Richard Reina
Hello All, Happy Friday! I know how to do the following query: >select count(*) from sales where WEEK(sale_date)=15 AND YEAR(sale_date)=2013; But can someone tell me I can do a query that will give me: the count(*) for each week of 2013 so that I end up with: WEEK | COUNT 1 | 22 2

Re: Query Help

2013-04-19 Thread Richard Reina
Perfect! Thank you Larry et all. Have a great weekend. 2013/4/19 Larry Martell > On Fri, Apr 19, 2013 at 8:24 AM, Richard Reina > wrote: > > Hello All, > > > > Happy Friday! I know how to do the following query: > > > >>select count(*) from sales where WEEK(sale_date)=15 AND > > YEAR(sale_dat

Re: Query Help

2013-04-19 Thread Larry Martell
On Fri, Apr 19, 2013 at 8:24 AM, Richard Reina wrote: > Hello All, > > Happy Friday! I know how to do the following query: > >>select count(*) from sales where WEEK(sale_date)=15 AND > YEAR(sale_date)=2013; > > But can someone tell me I can do a query that will give me: > > the count(*) for each w

RE: Query Help

2013-04-19 Thread Ilya Kazakevich
Hello Richard, >the count(*) for each week of 2013 so that I end up with: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html Ilya. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: Query help - Solved

2013-03-31 Thread william drescher
of course, "Group By" bill -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: Query help -

2013-03-31 Thread william drescher
On 3/31/2013 7:32 AM, william drescher wrote: I have a table, schedule: CREATE TABLE `schedule` ( `schedule_id` mediumint(9) NOT NULL AUTO_INCREMENT, `provider` varchar(15) NOT NULL, `apptTime` datetime NOT NULL, `location` varchar(10) NOT NULL, `duration` smallint(5) unsigned NOT

Query help -

2013-03-31 Thread william drescher
I have a table, schedule: CREATE TABLE `schedule` ( `schedule_id` mediumint(9) NOT NULL AUTO_INCREMENT, `provider` varchar(15) NOT NULL, `apptTime` datetime NOT NULL, `location` varchar(10) NOT NULL, `duration` smallint(5) unsigned NOT NULL, `standing_script` mediumint(9) DEFAULT NULL,

RE: NOT_REGEXP Query Help

2012-10-01 Thread John Nichel
> -Original Message- > From: Rik Wasmus [mailto:r...@grib.nl] > Sent: Monday, October 01, 2012 10:44 AM > To: mysql@lists.mysql.com > Subject: Re: NOT_REGEXP Query Help > > > I'm having an issue using regular expressions, and I was hoping > > someon

Re: NOT_REGEXP Query Help

2012-10-01 Thread Rik Wasmus
> I'm having an issue using regular expressions, and I was hoping someone > can see the syntax error that I'm missing (Monday morning, not enough > coffee, etc). Running the following query returns the error: > > SELECT `a.custid`,`a.login` FROM ol.customers a WHERE `a.login` NOT_REGEXP > '^ano

NOT_REGEXP Query Help

2012-10-01 Thread John Nichel
Hi all, I'm having an issue using regular expressions, and I was hoping someone can see the syntax error that I'm missing (Monday morning, not enough coffee, etc). Running the following query returns the error: SELECT `a.custid`,`a.login` FROM ol.customers a WHERE `a.login` NOT_REGEXP '^anonym

RE: query help

2012-09-13 Thread Rick James
9 AM > To: 'Richard Reina'; mysql@lists.mysql.com > Subject: RE: query help > > I think this will get you there: > > SELECT LEAD, COUNT(*) FROM ORDERS GROUP BY LEAD; > > It'll give you something more like: > > | LEAD | COUNT(*) | > | F | 44

RE: query help

2012-09-13 Thread Stillman, Benjamin
Reina [mailto:gatorre...@gmail.com] Sent: Thursday, September 13, 2012 9:51 AM To: mysql@lists.mysql.com Subject: query help I have a table like this: |ORDERS| |ID| DATE | QNT | LEAD | |342 | 8-12-12 | 32 | F| |345 | 8-15-12 | 12 | S| |349 | 8-16-12 | 9 | R|

query help

2012-09-13 Thread Richard Reina
I have a table like this: |ORDERS| |ID| DATE | QNT | LEAD | |342 | 8-12-12 | 32 | F| |345 | 8-15-12 | 12 | S| |349 | 8-16-12 | 9 | R| I am looking for a way to query it with counts by the LEAD column in order to tell what the number of each type lead is,

Re: query help

2012-08-07 Thread hsv
2012/07/31 15:02 -0700, Haluk Karamete So, in a case like this shop.orders.32442 shop.orders.82000 shop.orders.34442 It would be the record whose source_recid is shop.orders.82000. Why? Cause 82000 happens to be the largest integer. Now, if they are always 5-digit-long integer

Re: query help

2012-08-01 Thread Vikas Shukla
Hi, Use LIMIT 1 to limit the number of output to single record. Regards, Vikas Shukla On Wed, Aug 1, 2012 at 3:56 AM, Paul Halliday wrote: > On Tue, Jul 31, 2012 at 7:02 PM, Haluk Karamete > wrote: > > I've got a text field called source_recid. It stores half string half > > number like str

RE: query help

2012-08-01 Thread Rick James
L > Subject: Re: query help > > On Tue, Jul 31, 2012 at 7:02 PM, Haluk Karamete > wrote: > > I've got a text field called source_recid. It stores half string half > > number like strings in it. > > > > Example > > > > shop.orders.32442 > >

Re: query help

2012-07-31 Thread Paul Halliday
On Tue, Jul 31, 2012 at 7:02 PM, Haluk Karamete wrote: > I've got a text field called source_recid. It stores half string half > number like strings in it. > > Example > > shop.orders.32442 > > the syntax is DATABASENAME.TABLENAME.RECID > > My goal is to scan this col and find out the biggest RECI

query help

2012-07-31 Thread Haluk Karamete
I've got a text field called source_recid. It stores half string half number like strings in it. Example shop.orders.32442 the syntax is DATABASENAME.TABLENAME.RECID My goal is to scan this col and find out the biggest RECID ( the integer) in it. So, in a case like this shop.orders.32442 shop

Re: Need Query Help

2012-06-22 Thread Shawn Green
On 6/22/2012 12:18 AM, Anupam Karmarkar wrote: Thanks Rick for your reply, Here i am asking about logic to perpare query or whole query itself. A set-based approach to doing the basic task is to convert your set of start/stop times into duration values. The timediff() function mentioned alr

Re: Need Query Help

2012-06-21 Thread Anupam Karmarkar
Thanks Rick for your reply, Here i am asking about logic to perpare query or whole query itself. --Anupam From: Rick James To: Anupam Karmarkar ; "mysql@lists.mysql.com" Sent: Wednesday, 20 June 2012 10:52 PM Subject: RE: Need Query H

RE: Need Query Help

2012-06-20 Thread Rick James
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timediff and SEC_TO_TIME()/3600 > -Original Message- > From: Anupam Karmarkar [mailto:sb_akarmar...@yahoo.com] > Sent: Wednesday, June 20, 2012 2:39 AM > To: mysql@lists.mysql.com > Subject:

Need Query Help

2012-06-20 Thread Anupam Karmarkar
Hi All, I need query help for following table struture, where we need to calculate login duration of that employee for give period. Example table EmployeeID     LoginTime   LogoutTIme 101            2012-05-01 10:00:00     2012-05-01 12:30:00 102            2012

Re: Query help...

2012-05-28 Thread hsv
2012/05/28 08:03 -0700, Don Wieland Any assistance would be appreciated. Thanks! Maybe something like this: SELECT usie.client_id, first_name, last_name, COUNT(anie.client_id) FROM (SELECT client_id, first_name, last_name, time_start FROM tl_appt JOIN tl_rooms USING(room_id)

Query help...

2012-05-28 Thread Don Wieland
I have been working with a query but need to add a few more conditions. I was a to do a query that contains a few more selects but want to know if there is a more efficient way to get results I need: This query is to find NEW or FORMER CLIENT within a moving window (Date Range) of time. I

Re: SQL query help. Retrieve all DVDs that have at least one scene of a certain encoding format

2012-05-19 Thread Baron Schwartz
I would work from the inside out. What you're doing is grouping scenes by DVD and throwing away the ones that have no scenes. If you start with DVDs and do a subquery for each row, you'll process DVDs without scenes and then filter them out. If you start with a subquery that's grouped by DVD ID, al

RE: SQL query help. Retrieve all DVDs that have at least one scene of a certain encoding format

2012-05-19 Thread Daevid Vincent
elly [mailto:my...@wastedtimes.net] Sent: Saturday, May 19, 2012 3:34 PM To: mysql@lists.mysql.com Subject: Re: SQL query help. Retrieve all DVDs that have at least one scene of a certain encoding format Hi. On Friday 18 May 2012 18:21:07 Daevid Vincent wrote: > Actually, I may have figured

Re: SQL query help. Retrieve all DVDs that have at least one scene of a certain encoding format

2012-05-19 Thread Mark Kelly
Hi. On Friday 18 May 2012 18:21:07 Daevid Vincent wrote: > Actually, I may have figured it out. Is there a better way to do this? I don't see why you need the dvds table when the dvd_id is in the scene table: SELECT a.dvd_id FROM scenes_list a, moviefiles b WHERE a.scene_id = b.scene_id AND

RE: SQL query help. Retrieve all DVDs that have at least one scene of a certain encoding format

2012-05-18 Thread Daevid Vincent
> -Original Message- > Sent: Friday, May 18, 2012 5:34 PM > > I have a table of DVDs, another of scenes and a last one of encoding > formats/files... > > I want to find in one query all the dvd_id that have > 0 scene_id that's > encoded in format_id = 13. > In other words all DVDs that ar

SQL query help. Retrieve all DVDs that have at least one scene of a certain encoding format

2012-05-18 Thread Daevid Vincent
I have a table of DVDs, another of scenes and a last one of encoding formats/files... I want to find in one query all the dvd_id that have > 0 scene_id that's encoded in format_id = 13. In other words all DVDs that are format_id = 13 despite not having a direct link. CREATE TABLE `dvds` ( `dvd_

Re: Query help,,,

2012-05-17 Thread Peter Brawley
On 2012-05-17 9:37 AM, Don Wieland wrote: Hi folks, I am trying to compile a query that does statistics on appointments based on specific criteria. Here is my starting query: SELECT u.user_id, c.client_id, c.first_name, c.last_name, a.time_start AS stime, FROM_UNIXTIME

RE: Query help,,,

2012-05-17 Thread Rick James
| 40 | | AZ| Phoenix |1428509 | 51 | | CA| Los Angeles |3877129 |447 | ... > -Original Message- > From: Don Wieland [mailto:d...@pointmade.net] > Sent: Thursday, May 17, 2012 7:37 AM > To: mysql@lists.mysql.com > Subject: Query help,,, >

Query help,,,

2012-05-17 Thread Don Wieland
Hi folks, I am trying to compile a query that does statistics on appointments based on specific criteria. Here is my starting query: SELECT u.user_id, c.client_id, c.first_name, c.last_name, a.time_start AS stime, FROM_UNIXTIME(a.time_start,'%Y-%m-%d') AS formatted F

Re: A Simple Query Help

2012-04-22 Thread Igor Shevtsov
Hi Rafael, You can try using correlated subquery instead of outer join. This can be slow with big tables though: SELECT * FROM users WHERE accept_email = 1 and email not in (SELECT email FROM sent_emails WHERE sent_emails .email = users.email AND messageID NOT LIKE = ‘XX’) OR OUTER JOIN as

A Simple Query Help

2012-04-22 Thread Rafael Ribeiro
Dear Friends, I m new on this list, and I m trying to learn more about mysql. After perform a lot of searchs in the Internet, I have no answer to my question and would like to ask your help. I wanna a perform a query that depends of the result from another (query) table inside the same

Re: Multi select Query help...

2012-03-03 Thread Hal�sz S�ndor
2012/03/01 19:56 -0800, Don Wieland I do not get the same results. Am I missing something? Hopefully something simple ;-) O, you are. You do not want GROUP_CONCAT in the subquery. It gives you the comma-separated string whereto you referred, which, as far as the IN goes, is o

Multi select Query help...

2012-03-01 Thread Don Wieland
Appreciate a little guidance here: Background: I have an invoicing system. Invoices are generated and (invoice and Invoice Items) and Payments are generated (Payments and Payment Items). Payment items are amount of the Payment Total allocated to payoff open invoices. So I may have 3 open in

Re: Query help...

2012-02-29 Thread Michael Heaney
On 2/29/2012 1:15 PM, Don Wieland wrote: Little help... In my mySQL query editor, I am trying to return a value of 0 when there is no related rows from this query: (select if(count(ip.payment_amount) IS NOT NULL, count(ip.payment_amount) , 0) FROM tl_trans_pmt_items ip WHERE t.transaction_id =

Re: Query help...

2012-02-29 Thread Singer X.J. Wang
http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html#function_ifnull On Wed, Feb 29, 2012 at 13:15, Don Wieland wrote: > Little help... > > In my mySQL query editor, I am trying to return a value of 0 when there is > no related rows from this query: > > (select if(count(ip.payment_

Query help...

2012-02-29 Thread Don Wieland
Little help... In my mySQL query editor, I am trying to return a value of 0 when there is no related rows from this query: (select if(count(ip.payment_amount) IS NOT NULL, count(ip.payment_amount) , 0) FROM tl_trans_pmt_items ip WHERE t.transaction_id = ip.inv_id GROUP BY ip.inv_id) as d

RE: Within-group aggregate query help please - customers and latest subscription row

2011-10-25 Thread Hal�sz S�ndor
2011/10/24 16:31 -0700, Daevid Vincent WHERE cs.customer_id = 7 GROUP BY customer_id Well, the latter line is now redundant. How will you make the '7' into a parameter? -- MySQL General Mailing List For list archives: http://l

RE: Within-group aggregate query help please - customers and latest subscription row

2011-10-24 Thread Daevid Vincent
October 24, 2011 4:06 PM > To: mysql@lists.mysql.com > Subject: RE: Within-group aggregate query help please - customers and latest > subscription row > > A kind (and shy) soul replied to me off list and suggested this solution, > however, > this takes 28 seconds (that's f

RE: Within-group aggregate query help please - customers and latest subscription row

2011-10-24 Thread Daevid Vincent
- > From: Daevid Vincent [mailto:dae...@daevid.com] > Sent: Monday, October 24, 2011 1:46 PM > To: mysql@lists.mysql.com > Subject: Within-group aggregate query help please - customers and latest > subscription row > > I know this is a common problem, and I've been struggling

Within-group aggregate query help please - customers and latest subscription row

2011-10-24 Thread Daevid Vincent
I know this is a common problem, and I've been struggling with it for a full day now but I can't get it. I also tried a few sites for examples: http://www.artfulsoftware.com/infotree/queries.php#101 http://forums.devarticles.com/general-sql-development-47/select-max-datetime -problem-10210.html

Re: Optimize query help.

2011-03-15 Thread Michael Dykman
The OR conditions require a full table scan everytime this is called. You didn't say how many rows you had, nor if there were indexes on your various phone_xxx fields. If you do, you should get some value by approaching it as a UNION select count(id)from ( select id from leads where phone_work

Optimize query help.

2011-03-15 Thread Paul Nowosielski
Dear all, I have a query that takes a rather long time and was wondering if there is anyway to optimize it. Normally we removing duplicate records by phone number. This query takes about a second and it really slows down the process when we are importing several 1000 records a day. Here is

RE: Query help

2011-03-02 Thread Jerry Schwartz
lto:neil.tompk...@googlemail.com] >Sent: Wednesday, March 02, 2011 10:12 AM >To: Jerry Schwartz >Cc: [MySQL] >Subject: Re: Query help > >Thanks for the response. This is what I was after. Although, I am looking >to find out the email addresses used to login from the same IP

Re: Query help

2011-03-02 Thread Tompkins Neil
il.com] > >Sent: Wednesday, March 02, 2011 6:00 AM > >To: [MySQL] > >Subject: Query help > > > >Hi > > > >I've the following basic table > > > >login_id > >email_address > >ip_address > > > >I want to extract all reco

RE: Query help

2011-03-02 Thread Jerry Schwartz
>-Original Message- >From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] >Sent: Wednesday, March 02, 2011 6:00 AM >To: [MySQL] >Subject: Query help > >Hi > >I've the following basic table > >login_id >email_address >ip_address > &g

Re: Query help

2011-03-02 Thread Claudio Nanni
Hi Neil, select login_id, ip_address from basic_table group by login_id,ip_address having count(login_id,ip_address)>1 this should work in case you want to see also the list of emails add: group_concat(email_address,',') as list_of_used_emails to the select fields. Claudio

Query help

2011-03-02 Thread Tompkins Neil
Hi I've the following basic table login_id email_address ip_address I want to extract all records from this table in which a user has used the same IP address but different email address to login ? Thanks, Neil

Re: Query Help

2010-10-27 Thread Shawn Green (MySQL)
On 10/27/2010 6:55 AM, Nuno Mendes wrote: I have 3 tables: (1) Companies, (2) locations and (3) employees: CREATE TABLE `companies` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(75) NOT NULL, UNIQUE KEY `id` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 CREATE TABLE `locations ` ( `id` i

Query Help

2010-10-27 Thread Nuno Mendes
I have 3 tables: (1) Companies, (2) locations and (3) employees: CREATE TABLE `companies` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(75) NOT NULL, UNIQUE KEY `id` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 CREATE TABLE `locations ` ( `id` int(11) NOT NULL AUTO_INCREMENT, `

Re: Advanced query help

2010-09-27 Thread Johan De Meersman
Then you'll probably need to define it with a separate select before using it. I'm half-guessing here, really, but that sounds like it makes sense :-) On Mon, Sep 27, 2010 at 11:49 AM, Tompkins Neil < neil.tompk...@googlemail.com> wrote: > Hi, > > I did try defining it before the IF statement, bu

Re: Advanced query help

2010-09-27 Thread Tompkins Neil
Hi, I did try defining it before the IF statement, but still the same ? Cheers Neil On Mon, Sep 27, 2010 at 7:58 AM, Johan De Meersman wrote: > At a guess, because you use @team in an if statement before you actually > define it. > > > On Sun, Sep 26, 2010 at 12:35 AM, Tompkins Neil < > neil.to

Re: Advanced query help

2010-09-26 Thread Johan De Meersman
At a guess, because you use @team in an if statement before you actually define it. On Sun, Sep 26, 2010 at 12:35 AM, Tompkins Neil < neil.tompk...@googlemail.com> wrote: > Hi, > > I've the following query > > SELECT teams_id AS teams_id ,SUM(rating) AS total_team_rating FROM (SELECT > teams_id

Advanced query help

2010-09-25 Thread Tompkins Neil
Hi, I've the following query SELECT teams_id AS teams_id ,SUM(rating) AS total_team_rating FROM (SELECT teams_id ,players_id ,rating ,IF(@team <> teams_id, @row := 1, @row := @row + 1) AS rank ,@team := teams_id FROM ( SELECT players.teams_id ,players.players_id ,players_master.rating FROM player

Fwd: Query help please

2010-09-23 Thread Tompkins Neil
I wondered if anyone can help me ? Do you need any further information ? Cheers Neil -- Forwarded message -- From: Tompkins Neil Date: Thu, Sep 23, 2010 at 9:49 AM Subject: Query help please To: "[MySQL]" Hi all, I've the following

Query help please

2010-09-23 Thread Tompkins Neil
Hi all, I've the following query : SELECT fixtures_results.seasons_id , home_teams_id AS teams_id , 1 AS home ,0 AS away , (SELECT SUM(goals) FROM players_appearances WHERE fixtures_results.fixtures_results_id = players_appearances.fixtures_results_id AND players_appearances.teams_id = home_teams

Re: Query help

2010-09-06 Thread Tompkins Neil
For sure here is some sample data home_teams_id,away_teams_id,home_goals,away_goals,home_users_id,away_users_id 100,200,2,1,5,6 200,100,1,1,6,5 Here is two rows of data for the same fixture both home and away Let me know if you need any more info. Cheers Neil On Mon, Sep 6, 2010 at 1:08 PM,

Re: Query help

2010-09-06 Thread Ananda Kumar
Also, can u please lets u know the value's in this table. Just one row, an example would do. regards anandkl On Mon, Sep 6, 2010 at 5:35 PM, Tompkins Neil wrote: > These two fields > > home_goals and away_goals > > Cheers > Neil > > > On Mon, Sep 6, 2010 at 12:58 PM, Ananda Kumar wrote: > >>

Re: Query help

2010-09-06 Thread Tompkins Neil
These two fields home_goals and away_goals Cheers Neil On Mon, Sep 6, 2010 at 12:58 PM, Ananda Kumar wrote: > Tompkins, > Which field stores the result of matches. > > regards > anandkl > > On Mon, Sep 6, 2010 at 4:45 PM, Tompkins Neil < > neil.tompk...@googlemail.com> wrote: > >> Hi, >> >> I

Re: Query help

2010-09-06 Thread Ananda Kumar
Tompkins, Which field stores the result of matches. regards anandkl On Mon, Sep 6, 2010 at 4:45 PM, Tompkins Neil wrote: > Hi, > > I've the following fields within a table : > > fixtures_results_id > home_teams_id > away_teams_id > home_goals > away_goals > home_users_id > away_users_id > > From

Query help

2010-09-06 Thread Tompkins Neil
Hi, I've the following fields within a table : fixtures_results_id home_teams_id away_teams_id home_goals away_goals home_users_id away_users_id >From this I want to extract the following type of information if the home_users_id or away_users_id = 1 : total number of games games number of games

Re: query help

2010-08-21 Thread Travis Ard
-- From: "Steven Buehler" Sent: Friday, August 20, 2010 3:30 PM To: Subject: query help I am hoping that I can do this with one query, I have a table, "Domains" with 3 columns accountID, domainID, mailname what I am trying to do is find

query help

2010-08-20 Thread Steven Buehler
I am hoping that I can do this with one query, I have a table, "Domains" with 3 columns accountID, domainID, mailname what I am trying to do is find all accountID's for "domainID" of 12345 and see if a second row with "domainID" of 54321 exists for that "accountID,mailname". If it doesn't exis

Re: Query Help

2010-07-12 Thread Phillip Baker
Table 1 Product_id | Product_Name 1| Product A 2| Product B 3| Product C Table 2 Category_id | Category_Name 1 | Admin 2 | Marketing 3 | Support 4 | IT Table 3 Product_id

RE: Query Help

2010-07-12 Thread Jay Blanchard
[snip] For the life of me I cannot remember how to make a query like this and what it is called. I know it is fairly basic though. Table 1 Product_id Product_Name Table 2 Category_id, Category_name Table 3 Product_id, Category_id Each product can have one or more categories. So I want a result

Re: Query Help

2010-07-09 Thread Michael Satterwhite
I believe you're describing a crosstab query. This should help you put it together: http://rpbouman.blogspot.com/2005/10/creating-crosstabs-in-mysql.html ---Michael On Friday, July 09, 2010 07:37:41 pm Phillip Baker wrote: > Hello All, > > > For the life of me I cannot remember how to make a

Query Help

2010-07-09 Thread Phillip Baker
Hello All, For the life of me I cannot remember how to make a query like this and what it is called. I know it is fairly basic though. Table 1 Product_id Product_Name Table 2 Category_id, Category_name Table 3 Product_id, Category_id Each product can have one or more categories. So I want a

RE: query help

2010-06-16 Thread Martin Gainty
Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. > From: rich...@rushlogistics.com > To: joerg.bru...@sun.com; mysql@lists.mysql.com > Subject: Re: query help >

Re: query help

2010-06-16 Thread Richard Reina
Thank you very much for all the insightful replies. I think I can get it to work with a join. Joerg Bruehe wrote: > > Hi! > > > Jay Blanchard wrote: > > [snip] > > I have a table similar to this: > > > > - > > |transactions | > > |ID |DATE |

Re: query help

2010-06-16 Thread Joerg Bruehe
Hi! Jay Blanchard wrote: > [snip] > I have a table similar to this: > > - > |transactions | > |ID |DATE |EMPLOYEE| > |234 |2010-01-05| 345| > |328 |2010-04-05| 344| > |239 |2010-01-10| 344| > > Is there a way to query such a table to gi

RE: query help

2010-06-15 Thread Jay Blanchard
[snip] I have a table similar to this: - |transactions | |ID |DATE |EMPLOYEE| |234 |2010-01-05| 345| |328 |2010-04-05| 344| |239 |2010-01-10| 344| Is there a way to query such a table to give the days of the year that employee 344 did not

RE: query help

2010-06-15 Thread Gavin Towey
don't have a match is your answer. Regards, Gavin Towey -Original Message- From: Richard Reina [mailto:rich...@rushlogistics.com] Sent: Tuesday, June 15, 2010 11:30 AM To: mysql@lists.mysql.com Subject: query help I have a table similar to this: - |tr

query help

2010-06-15 Thread Richard Reina
I have a table similar to this: - |transactions | |ID |DATE |EMPLOYEE| |234 |2010-01-05| 345| |328 |2010-04-05| 344| |239 |2010-01-10| 344| Is there a way to query such a table to give the days of the year that employee 344 did not have

Re: Query Help!

2010-04-27 Thread Jo�o C�ndido de Souza Neto
Not tested, but I think it can help you or at least give you an ideia on how to do it. select EndDateTime + INTERVAL 1 SECOND as startLazy, (select StartDateTime - INTERVAL 1 SECOND from table t2 where t2.StartDateTime > t1.EndDateTime limit 1) as endLazy from table t1 where (select Star

Re: Query Help!

2010-04-27 Thread Johan De Meersman
Hmm. You seem to have overlap, too. I suspect this would be easiest to do in code - the data you're looking for doesn't exist in the data you have, only the opposite of that data does. You could try populating a table with a full day, using the resolution you need (1 minute resolution means 1440 r

Query Help!

2010-04-27 Thread John Daisley
Hi All, I have a query I need to run but can't think how to get this working so I am hoping someone can advise. I have a table which logs start and end times of Scheduled jobs. It includes for simplicity a `DayID`, `StartDateTime` and `EndDateTime` column. Both `StartDateTime` and `EndDateTime` a

RE: query help

2010-02-09 Thread Gavin Towey
SELECT ID, check_no, amount FROM payables UNION SELECT ID, check_no, amount FROM paychecks; Regards, Gavin Towey -Original Message- From: Richard Reina [mailto:rich...@rushlogistics.com] Sent: Tuesday, February 09, 2010 9:23 AM To: mysql@lists.mysql.com Subject: query help I am trying

query help

2010-02-09 Thread Richard Reina
I am trying to write a query that merges 2 columns from different tables and show them as one column of data. Something like the following. payables ID |check_no| amount| 3 |3478| 67.00 | 4 |3489| 98.00 | 8 |3476| 56.00 | paychecks ID |check_no| amount 23 |3469|498.00 |

Re: Query help

2009-12-13 Thread DaWiz
SELECT count(distinct trans_no) from SEARCHES WHERE comp_id=675 and result='o'; - Original Message - From: "Richard Reina" To: Cc: Sent: Sunday, December 13, 2009 11:36 AM Subject: Query help I was wondering if someone could lend a hand with the following q

Re: Query help

2009-12-13 Thread Colin Streicher
On December 13, 2009 01:36:41 pm Richard Reina wrote: > I was wondering if someone could lend a hand with the following query. I > have table. > > SEARCHES > > |ID |trans_no|comp_id|result > > 13 | 455| 675| o > 15 | 302| 675| o > 16 | 455| 675| o > 12 | 225|

RE: Query help

2009-12-13 Thread Jason Trebilcock
gt; From: Richard Reina [mailto:rich...@rushlogistics.com] > Sent: Sunday, December 13, 2009 12:37 PM > To: mysql@lists.mysql.com > Cc: rich...@rushlogistics.com > Subject: Query help > > I was wondering if someone could lend a hand with the following query. > I have table. > > SEARC

Query help

2009-12-13 Thread Richard Reina
I was wondering if someone could lend a hand with the following query. I have table. SEARCHES |ID |trans_no|comp_id|result 13 | 455| 675| o 15 | 302| 675| o 16 | 455| 675| o 12 | 225| 629| y SELECT count(*) FROM SEARCHES WHERE comp_id=675 AND result='o' G

Database design and query help

2009-11-16 Thread Eskil Kvalnes
Hello, Currently, I have four tables (Items, UpdatePrice, UpdateStatus and UpdateRelease). All the Update tables are linked to Items.ItemID via Update(Price|Status|Release)ItemKey. Personally, I don't feel that this is the best database design I could have, but I can't seem to come up with one tha

RE: Basic SQL Query Help Needed

2009-08-25 Thread Martin Gainty
: mysql@lists.mysql.com > From: c...@hosting4days.com > Subject: Basic SQL Query Help Needed > Date: Tue, 25 Aug 2009 16:21:45 -0700 > > I have a basic invoice table with related line items table > > Goal :I'd like to get ALL the related line items - for ALL the > &#x

Basic SQL Query Help Needed

2009-08-25 Thread c...@hosting4days.com
I have a basic invoice table with related line items table Goal :I'd like to get ALL the related line items - for ALL the 'open' invoices... -- this should get a list of open (unpaid) invoices $query_invoice = "SELECT DISTINCT ID from invoices where status = 'open'" - --

RE: Query Help

2009-02-10 Thread Ben Wiechman
: mysql@lists.mysql.com Subject: RE: Query Help "Ben Wiechman" wrote on 02/10/2009 01:30:14 PM: > Thanks for the input! That is close to what I need, however not exactly. It > will give me the last time a user logged into the host in question but I > want to prune users who hav

RE: Query Help

2009-02-10 Thread ddevaudreuil
"Ben Wiechman" wrote on 02/10/2009 01:30:14 PM: > Thanks for the input! That is close to what I need, however not exactly. It > will give me the last time a user logged into the host in question but I > want to prune users who have since logged into a different host. Basically > find out how man

RE: Query Help

2009-02-10 Thread Ben Wiechman
00 sec) -Original Message- From: Ben Wiechman [mailto:b...@meltel.com] Sent: Tuesday, February 10, 2009 11:32 AM To: mysql@lists.mysql.com Subject: Query Help I keep hacking at this but haven't been able to get it right yet. I have two tables Userinfo contains a login, User's Na

RE: Query Help

2009-02-10 Thread Ben Wiechman
he host in question the information is returned. This produces too many results as some of those users have since migrated to a different access point. -Original Message- From: Andrew Wallo [mailto:theme...@microneil.com] Sent: Tuesday, February 10, 2009 12:05 PM To: Ben Wiechman Subject: Re:

Query Help

2009-02-10 Thread Ben Wiechman
I keep hacking at this but haven't been able to get it right yet. I have two tables Userinfo contains a login, User's Name, Group Name Log contains login, host, datetime of last login What I need to do is return user information (userinfo.name/groupname) of users that have logged into

sub query help

2008-08-18 Thread Paul Nowosielski
Dear All, I am interested in performing a sub query that removes duplicate records from a temporary table prior to pushing the data to the main table. I am not sure if it is possible and thought I would ask prior to the endeavor. I currently use php to perform this operation but is really bogs

Re: Query help, please..

2007-12-11 Thread Peter Brawley
Anders, >I also want to find out the user's position relative to others depending on the result. For a given pUserID, something like this? SELECT userid,result,rank FROM ( SELECT o1.userid,o1.result,COUNT(o2.result) AS rank FROM object o1 JOIN object o2 ON o1.result < o2.result OR (o1.resu

  1   2   3   4   5   6   >