select from multiple tables

2006-03-17 Thread Miguel Vaz
Hi guys, I am kinda new to mysql and on my endeavour to build a backend for a site i am building, i need to fetch data from a couple of tables, but dont know how to do it with a single select. Heres the problem: first table (products): id id_type

join between databases

2007-07-07 Thread Miguel Vaz
Hi, I am building a new system for the place i work and i was thinking about organizing my tables in several databases, like "management", "financial", "production_line" to make things more tidy. I will have tons of tables, so is it a usual procedure in organizing tables? The othe

change field types from several tables

2008-01-01 Thread Miguel Vaz
ALTER TABLE * CHANGE * * TEXT But obviously this doesnt work. Is this even possible using MYSQL? I could do it programmatically using PHP, i guess, but a single command would be far better. :-) Miguel Vaz -- MySQL General Mailing List For list archives: ht

select with table name

2008-02-16 Thread Miguel Vaz
Hi, I have a small issue that i can get my head around to solve: Is it possible to do a select from two tables using a union all (select * from t1 union all select * from t2), and have it display the table name in front of each row? What i need is, on the big resulting lis

simple alternate query

2007-01-27 Thread Miguel Vaz
Hi, I Cant get a simple query to work, heres what i am looking for: table1 -- id name 1 peter 2 john 3 mary 4 lisa 5 me I need a select that always ret

Re: simple alternate query

2007-01-27 Thread Miguel Vaz
I am dumb, so sorry: select * from table1 where id=1 or id >=3 and id <=4 Have to go spank myself until i bleed now, thanks. Miguel At 02:15 28-01-2007, Miguel Vaz wrote: Hi, I Cant get a simple query to work, heres wha

to join or not to join, that is the query

2007-02-10 Thread Miguel Vaz
Hi, i am having some difficulty to write a query for the following problem: I have three tables: TABLE Person - id_person, name, id_levelA, id_sizeA, id_levelB, id_sizeB TABLE Levels - id, desc TABLE Sizes - id, desc

INSERT using SELECT results

2007-02-18 Thread Miguel Vaz
Hi, I have a table LOCAIS with: id typedesc 1 t1 blah blah 2 t1 uihuih 3 t2 pokpokp I want to list only the distinct types and create a table with those results. I know how to list the distinct

Re: stuck on a query

2008-12-17 Thread Miguel Vaz
Got it to work perfectly, thanks, although it takes some time (CILS has >150.000 records). There was no need for unique since all the results are already surprisingly unique. Thank you, it was a different way of doing things. Well, different to me, at least. :-) In the meantime, i found an altern

Several languages for content

2009-11-27 Thread Miguel Vaz
Hi, This is my first post, and could use some points of view on the subject. Have a project that will have several languages for its records, for places, for example, whose names and descriptions will be in 3 languages. Have already read several sites about it but always end up with several persp

Re: Several languages for content

2009-11-27 Thread Miguel Vaz
t;"; } > elseif (ACTIVE_LANG == "spanish" && $RECIPES->name_spanish == "") { > $return = "".$RECIPES->name_english." [Sólo inglés disponible]"; } > elseif (ACTIVE_LANG == "english" && $RECIPES->name_english != &quo

Join using Table1 or Table2 - depending on content of rel table

2009-12-13 Thread Miguel Vaz
Hi, How would one go about doing this: - I have 3 tables: - A relationship table(REL), then TABLE1 and TABLE2: REL TABLE has fields: . ID . TYPE - type of event . ID_EVENT - id of event, but this id will either point to TABLE1 or TABLE2, depending on the content of the field "TYPE" Is it poss

Count records in join

2009-12-15 Thread Miguel Vaz
Hi, I am stuck with a suposedly simple query: - i have two tables (: PROGS id_prog name EVENTS id id_prog name How can i list all records from PROGS with a sum of how many events each have? I want to find the progs that are empty. I remember something about using NULL, but i cant remember. :-

Re: Count records in join

2009-12-16 Thread Miguel Vaz
will show all records that match and a >> row in the second table will all values NULL where there is no match. Then >> you find all those rows that have no match in your WHERE clause. >> >> Regards, >> Gavin Towey >> >> -Original Messag

Re: Count records in join

2009-12-16 Thread Miguel Vaz
essage- > >From: Miguel Vaz [mailto:pagong...@gmail.com] > >Sent: Wednesday, December 16, 2009 9:39 AM > >To: Johan De Meersman > >Cc: Gavin Towey; mysql@lists.mysql.com > >Subject: Re: Count records in join > > > >Thanks all for the feedback. Here's what i

table structure problem

2010-07-08 Thread Miguel Vaz
Hi, I am having some uncertainty while designing the following structure: I have two sets of data: * arqueology sites (can be natural): id name description id_category id_period x y * natural sites (can be arqueological also - bear with me -, so there will be duplicate records in the above ta

Re: table structure problem

2010-07-12 Thread Miguel Vaz
forgive the duplicate email. I replied only to you first, instead of all. On Mon, Jul 12, 2010 at 4:37 PM, Shawn Green (MySQL) < shawn.l.gr...@oracle.com> wrote: > On 7/8/2010 11:29 PM, Miguel Vaz wrote: > >> Hi, >> >> I am having some uncertainty while desi

Re: from excel to the mySQL

2010-08-03 Thread Miguel Vaz
Hi, Ive always used navicat for mysql and it does wonders for import/export (wether it be from excel or any other file type) and also general database management. Actually, too many features to list here, check the website: http://www.navicat.com/en/products/navicat_mysql/mysql_overview.html