left/right join concept
I'm trying to understand the terminology a bit. A left or right join can only exist for an outer join. For an inner join, the terminology would be out of context because inner joins are symmetrical (whereas outer joins are asymmetrical). Would this be a correct understanding? Anything to add or correct, please? thanks, Thufir -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: left/right join concept
That sounds like the technical answer. I prefer an analogy a 5th grader could understand. If you have 2 overlapping circles, and inner join is the area that overlaps. A left/outer join is the all of the left circle plus the content of the right circle that overlaps. A right/outer join is just the opposite. An outer join doesn't filter the table, it just finds any matching content if it's present. Anything without matching content has a null where normal matched content would be. Brent Baisley PHP, MySQL, Linux, Mac I write code On Mar 1, 2008, at 4:16 AM, Thufir wrote: I'm trying to understand the terminology a bit. A left or right join can only exist for an outer join. For an inner join, the terminology would be out of context because inner joins are symmetrical (whereas outer joins are asymmetrical). Would this be a correct understanding? Anything to add or correct, please? thanks, Thufir -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql? [EMAIL PROTECTED]
Re: left/right join concept
Somewhat tangential, but for whatever it is worth I agree with the view expressed at http://weblogs.sqlteam.com/jeffs/archive/2008/02/13/on-right-outer-joins.aspx: Right joins should be avoided (IMHO). Anything to add or correct, please? -- Rob Wultsch -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
DOES MYSQL HAS CONCEPT OF SYNONYM
Does anyone know if MySQL has the concept of Synonyms, as Oracle does? Raza -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: DOES MYSQL HAS CONCEPT OF SYNONYM
NOT DIRECTLY but if you're using (my)isam you can create softlinks on the underlying filesystem which is a really ugly hack but seems to work. Sid Lane DBA - Site Operations TWCi |-+ | | Ansari, Raza| | | \(GEI, GEFA\) | | | [EMAIL PROTECTED]| | | om | | || | | 02/02/2004 02:24 | | | PM | | || |-+ --| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: DOES MYSQL HAS CONCEPT OF SYNONYM | --| Does anyone know if MySQL has the concept of Synonyms, as Oracle does? Raza -- 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: about replication concept
MaFai [EMAIL PROTECTED] wrote: I would also like to know the impact when:- - the master db fail - a lot of insert/update transactions in the master, would it replicate immediately to the 2nd database If the mater db fail, how can be many inserts/updates? - when the secondary db fail, the master cannot send the data to the 2nd, would the data queue up ? Master doesn't send data to the slave, it writes all successful transaction to the binary logs. Slave connects to the master and read binary logs. So, if slave stops, it will read logs from the position on with it stops. - Any chance for the data in 2 db not sync, if so how to re-synchronize them ? In some cases queries are not written to the binary logs or they are not replicated. For example, if you specify binlog-do-db=some_db option on the master, current database isn't 'some_db' and you execute query like 'INSERT INTO some_db.some_tbl ..'. This query will not be written to the binary log. All theses cases are described in the manual. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
about replication concept
Hello, mysql, I would also like to know the impact when:- - the master db fail - a lot of insert/update transactions in the master, would it replicate immediately to the 2nd database - when the secondary db fail, the master cannot send the data to the 2nd, would the data queue up ? - Any chance for the data in 2 db not sync, if so how to re-synchronize them ? Best regards. MaFai [EMAIL PROTECTED] 2003-07-04 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Foreign Key Concept
# [EMAIL PROTECTED] / 2003-06-24 16:48:24 +0800: After I create this table,and add foreign key tno to this table. If I delete tno in p_program_type table,it would alarm that some data still in p_schedule. How can I define the p_schedule or p_program_type table to make sure that while delete the tno in p_program_type,the p_schedule table would delete the data matching p_schedule table. ON DELETE http://www.mysql.com/doc/en/InnoDB_foreign_key_constraints.html -- If you cc me or remove the list(s) completely I'll most likely ignore your message.see http://www.eyrie.org./~eagle/faqs/questions.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Foreign Key Concept
MaFai [EMAIL PROTECTED] wrote: After I create this table,and add foreign key tno to this table. If I delete tno in p_program_type table,it would alarm that some data still in p_schedule. How can I define the p_schedule or p_program_type table to make sure that while delete the tno in p_program_type,the p_schedule table would delete the data matching p_schedule table. create table p_schedule( sche_no int not null auto_increment, cno int not null, prog_no int not null, start_time datetime, end_timedatetime, index p_schedule_idx01 (cno), foreign key (cno) references p_channel (cno), index p_schedule_idx02 (prog_no), primary key(sche_no), foreign key (prog_no) references p_program( prog_no ), foreign key (tno) references p_program_type(tno) ) TYPE=INNODB; Take a look at ON DELETE clause: http://www.mysql.com/doc/en/InnoDB_foreign_key_constraints.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
follow up to file per field concept
context ... I had proposed writing a new backend for mysql tailored to read only very large and very wide (lots of columns) tables (14G + ) in which queries never involved more than a small percentage of the available columns (i.e. 5%) and often lacked WHERE clauses. A couple years ago I argued against the file per field disk layout on the belief that when the # and size of these files were too large that head movement back and forth would become the dominant time consumer and efficiency would drop. In practice though we were used to seeing the file per field theory perform roughly 10 times faster than an equivalent SQL database. Recently I became aware that on our largest table, detailed natality, query times had gone up radically half a year ago and the individual in charge had failed to determine what had gone wrong. I now believe that the performance was wrecked when the hard drive was defragmented. Originally the file per field files were written out en masse by a java program, but that would have left the resultant files fragmented, but fragmented in such a way that the head movement was minimized during a query. When the hard drive was defragged suddenly jumping back and forth between the different column files forced excessive head movement and performance went south. I still believe this technology has a lot to offer, but now am proposing that the columns be written as a single file and with a pseudo internal fragmentation. For col a, b and c, .. a1, a2, a3... aN, b1, b2, b3 ... bN, c1, c2, c3, ... CN aN+1, ..., bN+1, ... CN+1 ... and then we have the factor of 10 improvement over the usual sql table layout for the very particular query pattern that this is designed to solve. (note ... N needs to be determined after studying OS/controller/harddrive functions to minimize head seek) ANYWAY, wanted to make sure this hit the list before someone tried to experiment with a file per field approach. -- Heitzso [EMAIL PROTECTED] MetaMedia, Inc. - 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
Concept
I would like to know if MySQL has the same concept like Oracle has about Instance? or phisical structure like datafiles, control files, etc. ___ Yahoo! Encontros O lugar certo para encontrar a sua alma gêmea. http://br.encontros.yahoo.com/ - 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
Concept
I would like to know if MySQL has the same concept like Oracle has about Instance? or phisical structure like datafiles, control files, etc. Regards Alexander sql, query ___ Yahoo! Encontros O lugar certo para encontrar a sua alma gêmea. http://br.encontros.yahoo.com/ - 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: Concept
On Tue, Jul 16, 2002 at 08:59:12PM -0300, Alexander Burbello wrote: I would like to know if MySQL has the same concept like Oracle has about Instance? or phisical structure like datafiles, control files, etc. If you explain the concepts, we can probably help answer your questions. Jeremy -- Jeremy D. Zawodny | Perl, Web, MySQL, Linux Magazine, Yahoo! [EMAIL PROTECTED] | http://jeremy.zawodny.com/ MySQL 3.23.51: up 48 days, processed 1,021,082,138 queries (246/sec. avg) - 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: Concept
Hi, If you mean the concept (in Oracle) where an instance is effectively one database, the architectures differ a whole lot. Whereas Oracle, as I said, creates an instance for each database it's running, MySQL can handle several databases within one server process instance. The concept of data files is different, too. In Oracle you can define tablespaces that can span one or more datafiles. Then you create your tables into those tablespaces (--data files). MySQL, by default, creates three files per table: [tblname].MYI (indices built on the table), [tblname].MYD (the actual data - this is often the biggest file in a physical table representation), and [tblname].frm within which lies the definition (column names, data types etc.) of the table. MySQL doesn't have real control files like Oracle, it uses my.cnf instead to supply some values to the server that can't be specified runtime. You can, however, control the behaviour of the mysqld(-nt).exe by using some of the command-line startup parameters, if you like. Hope this helps! :-) Regards, Iikka ** * Iikka Meriläinen * * IT Support * * Vaalan kunta * * -- * * E-mail: [EMAIL PROTECTED] * ** On Tue, 16 Jul 2002, Alexander Burbello wrote: I would like to know if MySQL has the same concept like Oracle has about Instance? or phisical structure like datafiles, control files, etc. - 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: MySQL concept question
Can I hide the auto_increment field? -Original Message- From: Gregory Junker [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 11, 2002 5:23 PM To: MySQL Subject: RE: MySQL concept question if you are interested in selecting records in the order in which they were inserted, apply an auto-increment/identity field to your table schema and when you select, use ORDER BY on that field. This is the only guaranteed way to retrieve records in the order in which they were inserted. -Original Message- From: Thi Cao [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 11, 2002 6:09 PM To: MySQL Subject: MySQL concept question All, When I insert records into a database, the records will be inserted in the order that I have them listed in my insert statement. So my question is, will the MySQL database always return the records in the order of insertion when I perform any type of select query in the future? Of course, I'm excluding queries that specify an order with the 'ORDER BY' clause. Does the MySQL database maintain some type of internal ordering ID for each record, and if so, can I always rely on the database to give me the records back as I have given to it? I know I can specify an order by having a column with some type of ordering value, but that's not what I'm interested in, so any answers to the above questions would be much appreciated. T.I.A. Thi - 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 - 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 - 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: MySQL concept question
Sure, just don't include it in the list of columns to bring back. SELECT column1, column2 FROM ... instead of SELECT * FROM... or SELECT columnIDoNotWant, column1, column2 FROM ... On Friday 12 April 2002 3:29 pm, Thi Cao wrote: Can I hide the auto_increment field? -Original Message- From: Gregory Junker [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 11, 2002 5:23 PM To: MySQL Subject: RE: MySQL concept question if you are interested in selecting records in the order in which they were inserted, apply an auto-increment/identity field to your table schema and when you select, use ORDER BY on that field. This is the only guaranteed way to retrieve records in the order in which they were inserted. -Original Message- From: Thi Cao [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 11, 2002 6:09 PM To: MySQL Subject: MySQL concept question All, When I insert records into a database, the records will be inserted in the order that I have them listed in my insert statement. So my question is, will the MySQL database always return the records in the order of insertion when I perform any type of select query in the future? Of course, I'm excluding queries that specify an order with the 'ORDER BY' clause. Does the MySQL database maintain some type of internal ordering ID for each record, and if so, can I always rely on the database to give me the records back as I have given to it? I know I can specify an order by having a column with some type of ordering value, but that's not what I'm interested in, so any answers to the above questions would be much appreciated. T.I.A. Thi - 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 - 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 - 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 - 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: MySQL concept question
On Thursday 11 April 2002 4:09 pm, Thi Cao wrote: All, When I insert records into a database, the records will be inserted in the order that I have them listed in my insert statement. So my question is, will the MySQL database always return the records in the order of insertion when I perform any type of select query in the future? Of course, I'm excluding queries that specify an order with the 'ORDER BY' clause. Does the MySQL database maintain some type of internal ordering ID for each record, and if so, can I always rely on the database to give me the records back as I have given to it? I know I can specify an order by having a column with some type of ordering value, but that's not what I'm interested in, so any answers to the above questions would be much appreciated. While I cannot speak for MySQL, you cannot generally rely on this. Certainly, SQL specifications are clear that you cannot rely on this and in general, it is a very bad plan. - 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: MySQL concept question
if you are interested in selecting records in the order in which they were inserted, apply an auto-increment/identity field to your table schema and when you select, use ORDER BY on that field. This is the only guaranteed way to retrieve records in the order in which they were inserted. -Original Message- From: Thi Cao [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 11, 2002 6:09 PM To: MySQL Subject: MySQL concept question All, When I insert records into a database, the records will be inserted in the order that I have them listed in my insert statement. So my question is, will the MySQL database always return the records in the order of insertion when I perform any type of select query in the future? Of course, I'm excluding queries that specify an order with the 'ORDER BY' clause. Does the MySQL database maintain some type of internal ordering ID for each record, and if so, can I always rely on the database to give me the records back as I have given to it? I know I can specify an order by having a column with some type of ordering value, but that's not what I'm interested in, so any answers to the above questions would be much appreciated. T.I.A. Thi - 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 - 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 I use the concept of Effective Date with MySQL?
I've got the same issue that you do. Here is my thinking thus far: Say I have a transaction table: Record_Key Service_Date Item_Code Item_Quantity I'm considering this structure for the rate table: Item_Code Effective_Date Rate It's practical from a data entry perspective, but I can't seem to write a single query that says 'join the transaction table to the rate table where Service_Date = Effective_Date, and only get the latest rate record for each item_code'. The assumption here is that there is only a record added to the table when a new rate is about to be implemented. Of course, one could use client side logic and multiple queries to get the desired result. It's more likely I'll wind up with this kind of rate table: Item_Code Effective_Date_From Effective_Date_Thru Rate At least then, I can join by item code and use a where clause to restrict the transaction service date to be within the effective date range. The only issue here is that I'll need quite good control over the data entry process to be sure that date ranges never overlap, or the join mechanism could return more than one rate record, and perhaps cause an incorrect result. I have also considered a somewhat novel alternative, which is to use the first table structure, but use it to build a table that has each and every day populated for each item. That way, an exact join could always be made by Item Code and Service Date. The drawback here is that it wastes a lot of space just to make a convenient join. 1000 items for one year would require 365,000 records, a considerable waste of space. If anyone has a more reasonable idea, please add to the discussion. Regards, Rich At 07:52 PM 11/1/01, Alejandro Zuzenberg wrote: I need to select the appropriate price for a product in a table, and the product has a compund key with 2 fields: product number and date. For every transaction with a certain product, I need to retrieve the price that was 'current' at the specific time when that transaction took place. In joining two tables, I need to relate the price of a product to every sales transaction where that product was used, not only by product number but also by the effective date for that price. How can I do this? Is there a 'closest' function (the highest value that is or = ) to be used in a WHERE statment ? I've been searching for this for hours and could not fnd a solution with MySql. - 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
Can I use the concept of Effective Date with MySQL?
I need to select the appropriate price for a product in a table, and the product has a compund key with 2 fields: product number and date. For every transaction with a certain product, I need to retrieve the price that was 'current' at the specific time when that transaction took place. In joining two tables, I need to relate the price of a product to every sales transaction where that product was used, not only by product number but also by the effective date for that price. How can I do this? Is there a 'closest' function (the highest value that is or = ) to be used in a WHERE statment ? I've been searching for this for hours and could not fnd a solution with MySql. Thanks! Alejandro [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com - 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 I use the concept of Effective Date with MySQL?
SELECT price FROM mytable WHERE price = theprice DESC LIMIT 1; -Original Message- From: Alejandro Zuzenberg [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 01, 2001 7:53 PM To: [EMAIL PROTECTED] Subject: Can I use the concept of Effective Date with MySQL? I need to select the appropriate price for a product in a table, and the product has a compund key with 2 fields: product number and date. For every transaction with a certain product, I need to retrieve the price that was 'current' at the specific time when that transaction took place. In joining two tables, I need to relate the price of a product to every sales transaction where that product was used, not only by product number but also by the effective date for that price. How can I do this? Is there a 'closest' function (the highest value that is or = ) to be used in a WHERE statment ? I've been searching for this for hours and could not fnd a solution with MySql. Thanks! Alejandro [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com - 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 - 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 I use the concept of Effective Date with MySQL?
I have had to do this problem and i solved it by having 4 fields, Normalprice (PrPrice), Tempprice (PrTempPrice), Start date (PrStart) End Date (PrStop). In the select IF(((CURDATE() = PRStart) and (PRStop = CURDATE())), PrTempPrice, PrPrice) as CurrentPrice hope this helps On Thu, 1 Nov 2001, Rick Emery wrote: Date: Thu, 1 Nov 2001 17:20:00 -0600 From: Rick Emery [EMAIL PROTECTED] To: 'Alejandro Zuzenberg' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: Can I use the concept of Effective Date with MySQL? SELECT price FROM mytable WHERE price = theprice DESC LIMIT 1; -Original Message- From: Alejandro Zuzenberg [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 01, 2001 7:53 PM To: [EMAIL PROTECTED] Subject: Can I use the concept of Effective Date with MySQL? I need to select the appropriate price for a product in a table, and the product has a compund key with 2 fields: product number and date. For every transaction with a certain product, I need to retrieve the price that was 'current' at the specific time when that transaction took place. In joining two tables, I need to relate the price of a product to every sales transaction where that product was used, not only by product number but also by the effective date for that price. How can I do this? Is there a 'closest' function (the highest value that is or = ) to be used in a WHERE statment ? I've been searching for this for hours and could not fnd a solution with MySql. Thanks! Alejandro [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com - 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 - 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 Sincerely, William Mussatto, Senior Systems Engineer CyberStrategies, Inc ph. 909-920-9154 ext. 27 - 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
concept of users connecting from different host
hi, i don't understand what does connecting from different host mean? 1. does it mean connecting from a different pc to the pc hosting the mysql server through telnet? 2. connecting from the same pc hosting the mysql server and specifying the host when connecting? 3. running mysql client on a local computer and connecting to the pc hosting the mysql server. how do you connect in thisway then? thks for any advice. shane - 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: concept of users connecting from different host
i don't understand what does connecting from different host mean? Where do you have this problem? 1. does it mean connecting from a different pc to the pc hosting the mysql server through telnet? Why would you like to do that? looks like a masochistic approach to me, under normal circumstances. 2. connecting from the same pc hosting the mysql server and specifying the host when connecting? Which would be localhost then, right? 3. running mysql client on a local computer and connecting to the pc hosting the mysql server. how do you connect in thisway then? Well, i do it through the browser as I use mysql on my server. in this approach, the connection is done through a cgi program running on the server, in my case php. in other words, I use php functions to connect to mysql, which means that the program connects to localhost. If I would like to connect, say, from your program on one machine to a database on another machine, then you will have to address that machine directly, for example with the IP number of that machine. You will have to insert a new user in the mysql database. Example: I manage my server databases through phpMyAdmin. This is a server based program, so it connects like all other server stuff through localhost. No problem. Recently, I downloaded mysqlfront (http://www.mysqlfront.de/). I liked that program very much, but as it runs as a standalone program on my client machine, it can connect to the database on that machine as localhost, but not to the web server. In order to do that, I would have to set up a new user and such. Another example. In addition to my own project, I have several customer projects. When I wanted to integrate data from a customer into my own project, I couldn't connect to the database of the customer directly because the ISP wouldn't allow it. When we moved to our own dedicated server, I moved the site of this customer to this machine, too. As I was master of this machine now, I could have realized my original plan to tap into the live data of this customer. In this case, both databases would reside on localhost. But it turned out that we had some problems. Now we moved our project to a separate dedicated server. As I am master of both machines, I will have to introduce the machine address of our project into the user table of the machine with the customer's data to realize my original plan. -- Herzlich Werner Stuerenburg _ ISIS Verlag, Teut 3, D-32683 Barntrup-Alverdissen Tel 0(049) 5224-997 407 · Fax 0(049) 5224-997 409 http://pferdezeitung.de - 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