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: 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'" - --

SQL Query help

2006-10-08 Thread C K
Friends, I am developing a database for accounting software. I have one problem regarding calculation of balances on daily basis for all ledgers. I am using Access 2003 as frontend. While designing I found that maintaining of daily balances is impossible to client's requirements. But as the soluti

Re: SQL Query help

2004-02-19 Thread unix
>> This is probably tediously basic for all you super whiz > MySQL people > but help me out if you can. >> >> I have 2 tables in my database (there will be more) >> >> table_Applics & table_keywords >> >> I want to select columns of information from > table_applics based on the > ID results from ta

SQL Query help

2004-02-19 Thread Andy Fletcher
This is probably tediously basic for all you super whiz MySQL people but help me out if you can. I have 2 tables in my database (there will be more) table_Applics & table_keywords I want to select columns of information from table_applics based on the ID results from table_keywords. something

Re: SQL query help required

2004-02-03 Thread Jigal van Hemert
- Original Message - From: "Riaan Oberholzer" <[EMAIL PROTECTED]> > 2-0, 2-1, 2-2, 2-3 > 1-0, 1-1, 1-2, 1-3 > 0-0, 0-1, 0-2, 0-3 > SELECT CONCAT(predictionA, '-', predictionB) AS score, COUNT(CONCAT(predictionA, '-', predictionB)) AS count FROM table WHERE CONCAT(predictionA, '-', predic

SQL query help required

2004-02-03 Thread Riaan Oberholzer
Hi, Background: I run a prediction league for soccer competitions. For every game, I want to show how many predictions were submitted per scoreline, ie. 10% said 1-0 20% said 0-1 30% said 2-3 etc. My prediction table has a predictionA and predicionB column with the submitted scores. Currently I

Re: SQL query help

2003-10-02 Thread Svein E. Seldal
Hi, I forgot to mention that the table contains more information, it has more columns than just a and b. These extra columns contains the actual information that I'm looking for. I.e. the mentioned table could be looking like this: +--+--+--+--+-+--- | a| b| da

SQL query help

2003-10-02 Thread Svein E. Seldal
Hi, I have this table where the columns and rows are organized like this: +--+--+ | a| b| +--+--+ |1 |1 | |2 |1 | |2 |2 | |2 |3 | |2 |4 | |3 |1 | |3 |2 | +--+--+ I want to run a select that gives me one row fo

Re: A little SQL query help

2003-07-27 Thread Nils Valentin
tec Support" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Sunday, July 27, 2003 2:05 AM > Subject: Re: A little SQL query help > > > Hi Mark, > > > > 2003年 7月 27日 日曜日 06:09、Obantec Support さんは書きました: > > > Hi > > > > > > I have a

Re: A little SQL query help

2003-07-27 Thread Obantec Support
- Original Message - From: "Nils Valentin" <[EMAIL PROTECTED]> To: "Obantec Support" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, July 27, 2003 2:05 AM Subject: Re: A little SQL query help > Hi Mark, > > 2003年 7月 27日 日曜日 06:09、Ob

Re: Re[2]: A little SQL query help

2003-07-27 Thread Nils Valentin
Hi Ivan, depending on mark's needs (orginal poster of the question), you might be right. So far I have not so much experience with PHP. Best regards Nils Valentin Tokyo/Japan 2003年 7月 27日 日曜日 15:43、Ivan Cukic さんは書きました: > Nils> How about LIKE \"$%searchdata%\" ? > > The % sign should be in fr

Re: A little SQL query help

2003-07-26 Thread Nils Valentin
Hi Mark, 2003年 7月 27日 日曜日 06:09、Obantec Support さんは書きました: > Hi > > I have a database supplied to me that was excel but now uploaded to mysql. > (the data is out of my hands.) > > i need to search for 1 of 2 categories against 3 fields with user inputted > data. > > example Categories=Lessor , sear

A little SQL query help

2003-07-26 Thread Obantec Support
Hi I have a database supplied to me that was excel but now uploaded to mysql. (the data is out of my hands.) i need to search for 1 of 2 categories against 3 fields with user inputted data. example Categories=Lessor , searchtype = BusinessCity searchdata = (user input) $sql = "SELECT * FROM Con

Re: MySQL sql query help

2003-03-09 Thread Bruce Feist
Ben Balbo wrote: Seems MySQL doesn't much like having nested joins in joins... Oops! Sorry about that. (Curse me for a MySQL novice! ) However, your principles led me to my result. As the search page will pass the class ids in anyway, I don't need to read these from the table. I.E. I pass the

Re[2]: MySQL sql query help

2003-03-09 Thread Ben Balbo
Hi Bruce, Thanks for your reply. I just got the time to take a look at it, and it makes sense. However, for the first test: SELECT distinct t.name FROM Teacher t INNER JOIN (TeacherClass tc2 INNER JOIN Class c2 ON tc2.classid = c2.id AND c2.name = 'English') ON t.teacherid = tc2.teac

Re: MySQL sql query help

2003-03-07 Thread Bruce Feist
Ben Balbo wrote: Teacher (id, name, ...) TeacherClass (teacherid, classid, timestamp) Class (id, name, ...) Now, what I'd really like to do it find all teachers who, for example, taught Engligh and Math, but not Biology, Here's a general, recursive, untested solution for you to play with. We st

MySQL sql query help

2003-03-07 Thread Ben Balbo
Hi all, I've been trying to wrap my head round this problem for a few days now, and have plenty of pieces of scrap paper with lines and arrows and numbers to prove it. Anyway, here's the scenario: I have a table of teachers, and a table of classes. Any teacher can have taught any class, and any

MySQL sql query help

2003-03-07 Thread Ben Balbo
Hi all, I've been trying to wrap my head round this problem for a few days now, and have plenty of pieces of scrap paper with lines and arrows and numbers to prove it. Anyway, here's the scenario: I have a table of teachers, and a table of classes. Any teacher can have taught any class, and any

MySQL sql query help

2003-03-07 Thread Ben Balbo
Apologies if you now get this three times now, but I haven't received any copies through the mailing list yet, and the first 2 were sent 3 and 4 hours ago. I know email can go walkies for a few hours, but I've not been experiencing any other mail problems, either personally or in receiving MySQL m

Re: SQL Query Help

2002-10-04 Thread Shane Allen
On Fri, Oct 04, 2002 at 12:36:30PM -0700, David McInnis wrote: > Can someone please help me with the following? Normally I would do this > with a nested select, but since this is not available in MySQL I think I > need help. > > Here is what I have: An order table with sales tax total and an >

SQL Query Help

2002-10-04 Thread David McInnis
Can someone please help me with the following? Normally I would do this with a nested select, but since this is not available in MySQL I think I need help. Here is what I have: An order table with sales tax total and an orderdetail table with ordered, itemid and qty. What I need to do is form

Re: SQL query help

2002-07-13 Thread Erick Papadakis
Hi Craig, you wrote--- > select B.name,C.name > from lookuptable A, user B, cat C > where A.user = B.id > and A.category = C.id > and A.category in (3,5); > > The problem I see is that records come back where a user is in category > 3 or > category 5. How do I limit

SQL query help

2002-07-12 Thread Craig Coles
I know this is an off topic question, but wondered if anyone might have a moment to help. I wouldn't ask if I could do a sub-select... I am using mysql v3.23.51 and have a table I need to display the information of users who are working in both category 3 and category 5. Table def looks kind of

SQL query help

2002-05-29 Thread Mike Macias
I've been trying to solve this problem for a couple of days now. I've only started with DB's a month ago so I am no expert in SQL. So, I present this problem to you guys in hopes of getting a solution. Thanks in advance, Mike = Question: = Using the query below I get the result

sql,query help with performing an update on a SET datatype

2002-05-28 Thread Jason
OK, I cannot find this sql query on the website or in any of my manuals. I have a table that contains a set datatype eg CREATE TABLE testjason ( ID int(11) NOT NULL auto_increment, SomeSetColumn set('a','b','c') NOT NULL default '', ) TYPE=MyISAM; I neet to perform an UPDATE on this ta

RE: SQL Query Help

2002-04-03 Thread Danis Stéphane (NHQ-AC)
EMAIL PROTECTED] Subject: Re: SQL Query Help Stéphane, Have just re-read my response... * The main problem is the layout and the order of the results set. I will have 9 state (provinces) and I would prefer the month to be the columns. The ideal results would look like this, Please note I have

Re: SQL Query Help

2002-04-03 Thread DL Neil
Stéphane, Answers: There are nine different states (and there are 12 months). * The main problem is the layout and the order of the results set. I will have 9 state (provinces) and I would prefer the month to be the columns. The ideal results would look like this, Please note I have only incl

Re: SQL Query Help

2002-04-03 Thread denonymous
From: "Danis Stéphane (NHQ-AC)" <[EMAIL PROTECTED]> > My best code is this: > > SELECT SUM(invoice_amount), state, statement_date > FROM invoice > GROUP BY state, statement_date > > > The results are have followed: > The main problem is the layout and the order of the results set. I will have

RE: SQL Query Help

2002-04-03 Thread Danis Stéphane (NHQ-AC)
Neil [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 02, 2002 3:47 PM To: Danis Stéphane (NHQ-AC); [EMAIL PROTECTED] Subject: Re: SQL Query Help Stéphane, > I have INVOICE table here is the layout: > > +-+---+--+-+-+-- >

Re: SQL Query Help

2002-04-02 Thread DL Neil
Stéphane, > I have INVOICE table here is the layout: > > +-+---+--+-+-+-- > --+ > | Field | Type | Null | Key | Default | Extra > | > +-+---+--+-+-+-

SQL Query Help

2002-04-02 Thread Danis Stéphane (NHQ-AC)
I have INVOICE table here is the layout: +-+---+--+-+-+-- --+ | Field | Type | Null | Key | Default | Extra | +-+---+--+-+-+-- --+ | ID

RE: SQL QUERY help joining three tables

2002-03-16 Thread Roger Baklund
* John Hughes > I have three tables: > > students has student_id and student_name > parents has parent_id and parent_name > parentlog has student_id and parent_id > > I want to search the parentlog WHERE student_id = some_id > GROUP BY parent_id > > (This will bring back two rows when there are tw

SQL QUERY help joining three tables

2002-03-15 Thread John Hughes
SQL QUERY question I have three tables: students has student_id and student_name parents has parent_id and parent_name parentlog has student_id and parent_id I want to search the parentlog WHERE student_id = some_id GROUP BY parent_id (This will bring back two rows when there are two parents)

sql query help

2001-11-09 Thread Christian Andersson
I know, I know... this is not really an MySQL question but an ordinary SQL question.. but I need help with it.. Lets say that I have a table called test that has 3 columns test1,test2,test3 (what type they are are not interesting) columns test1 and test2 makes the primary key what I would like i