Complex Column Names
i have a table with name table1. That table has a column with name thing1/thing2, when i want to do a query like:
select thing1/thing2 from table1;
shows an error sin it interprets as if i wanted the column thing1 divided by the column thing2 (their values).
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Column Names
Is there something incorrect with the following query? INSERT INTO Faxes (Timestamp,Last Updated,Group,Flight,Poster,Origin,Destination,Title,TitleR,Comments,CommentsR,TTI,Private) VALUES ( '2005-08-08 10:11:50.156', '2005-08-08 10:11:50.156', 'ECG', 'Protocol', '-1', '1', '1', '123', '123', '1', '12', '123', '0' ); SELECT LAST_INSERT_ID() AS lastID;
Column Names
Is there a way for me to title a colum "Some_Column_Name", but then be able to list it as "Some Column Name" in a web site? Perhaps with column comments?
Column Names
I've done searches on www.google.com and on this forum and I still haven't found any info on retrieving column names from a table.
Identifying Column Names
PHP environment win XP mySQL 5 I have myTable in myDatabase. There are some columns in myTable, but I don't know their names and their attributes. How can I identify them? The would-be code below doesn't work correctly, but it will show what I want. would-be code show columns from myTable target result column1, column2, column3
Regexps Using Column Names
I want to match a "word" based on the column values of a table but only if the column value matches at the start of the "word". Example: table: num | food ------|------- 78 | sausage 46 | banana 37 | egg SELECT food FROM `table` where 78046 regexp num; This select retrieves both "sausage" and "banana" (both 78 and 46 match in 78046). What I want to retrieve is any food who's number matches at the beginning of the number in the select statement. E.G for above example, 78 matches at beginning of 78046, => "sausage". Normally using a regexp I can use the "^" to match at the beginning. But putting a table column (num) into the quotes, treats it as a string [ ...regexp "^num" ], and writing the carrot ^ bare is an error [ ...regexp ^num ] Any ideas?
Get Length Of Column Names
is there a possibility to check if somewhere in a table/db a column exists whichs name is longer than, for example, 50 chars?
Exporting Column Names
I'm exporting MySQL data using a sql script containing:: SELECT * FROM (database name) INTO OUTFILE (filename) FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY ' '; The file is created successfully but line 1 of the file does not contain the column names. Is there an option I need to enable in oder to produce this?
How To Find Column Names?
I'm working on a site in php and I need about 20 different delete statements. Now I was wondering if it was possible to make a function that would just need some parameters. There's on problem I can't solve.; in the general syntax "Delete from table where column_name = value" I can't seem to find a way to implement the column_name except doing it manually.. I always compare the value with the column where the primary key is located Is there a way to just say delete from table where primary key = value ? or delete from table where column1 = value ? if not is there a way to get the column names in a select command? Like "Select column_names from table" ??
Show Column Names In Php
I am using php and mysql and I want to show the column names. How do I go about doing this without hardcoding the headers in my php?
Getting Table Names As A Column
Let's say I have a database(mysql) with tables 1 to x (table1, table2,...) Table1: Columns: Description + Date Now I want to get all the rows from table 1 and do a union with all the tablenames. So my sql will be something like: Select Description From Table1 UNION SHOW TABLES as Description ORDER BY Description Desc.
Column And Table Names
i have a large problem , my hosting wont give me access to my phpmyadmin and so I cant backup my database, So I looked to back it up using php which was complicated and confusing, so I decided before they cut me off completely I would write a sql statement to list all table names and then all table columns in each table. I dont mind writing each script seperately. i.e. list all table names, then write a script to view names of the column for each table. I only have 20 tables so no big deal, getting really desperate. If someone could either post a script they have I can copy and customise, or point me in a direction I would appreciate that. Im no idiot at sql, just have never had to do this before and am unsure how to go about it.
Extra Column Names
I am inserting data into an empty table that has some extra column names as compared to the original table. The sql is: PHP Code: INSERT INTO `new_table` (`course_name` , `course_number` , `section`) SELECT distinct `course_name` , `course_number` , `section` FROM `original_data` If the new_table contains exactly the same column names then the sql works. If there is one extra column then the sql inserts exactly one row. I changed the (`course_name` , `course_number` , `section`) to (*) but this produces an error.
Finding Duplicate Names In A Column
I have 2 field in my table as id and name id Name 1 asd 2 asd 3 asd 4 acv 5 USD 6 USD 7 acx 8 zxc 9 xcv 10 ZXb I want to find out the duplicates names and their id and how many times a particular name duplicates ?
How To Differentiate Column Names In A Join?
I have table 1 It's column names are: username - password - email then there is table 2 It's column names are: username - color1- color2 When I do the join statement it displays username - password - email - username- color1 - color 2 If I want to call the username from the second table what would I have to do? I know normally you use ' . $row['username']. ' in the echo statement to call the username, but what would I do in this instance?
Reserved Words As Column Names
My understanding is that using reserved words as column names is allowable as long as they are quoted. I am trying to create a table dynamically with columns defined by the first row of a text file I import. Unfortunately, I have no control over the column names and the data provider has chosen to use the word "USE" as a column name. "USE" is a reserved word. To handle this, I tried quoting the word during the CREATE TABLE statement, as follows: CREATE TABLE my_table ( 'use' varchar(100) ) But this is still causing an error. Any suggestions for avoiding the obvious workaround of checking column names against reserved words and changing them when there is a conflict? I'd like to use the column names as defined by the data provider, if possible.
Using Database Contents As Column Names
I have two tables I'm trying to join up, and would like to know if the following is possible: table1 : SELECT * from mediatype +-------------+---------+ | mediatypeid | type | +-------------+---------+ | 1 | MP3 | | 2 | ra_low | | 3 | ra_med | | 4 | ra_high | +-------------+---------+ Table 2: SELECT trackid, mediatypeid, url from media +---------+-------------+----------------+ | trackid | mediatypeid | url | +---------+-------------+----------------+ | 1 | 1 | mymp3.mp3 | | 1 | 2 | myothermp3.mp3 | | 1 | 3 | busted.mp3 | | 1 | 4 | newmp3.mp3 | +---------+-------------+----------------+ What I'd like to be able to get out of these two tables is a result like this : +---------|-----------|----------------|------------|------------+ | trackid | MP3 | ra_low | ra_med | ra_high | +---------|-----------|----------------|------------|------------+ | 1 | mymp3.mp3 | myothermp3.mp3 | busted.mp3 | newmp3.mp3 | +---------|-----------|----------------|------------|------------+ Is there a way to do this completly in SQL? or i could employ PHP to help out.
Is There A Dynamic Column-names Capability?
I would like to know how to turn off column names from within a sql script. I know that this can be done when starting mysql, but I want to know if there is a way to do this once the server is already running. There does not appear to be a variable for column-names (using show global, session, or local I did not see anything that looked like it could be used), which sort of tells me that it is not possible to change the default enabled setting once the server is active. Does anyone know 1) if this is possible and 2) how it can be done?
Pattern Matching For Column Names?
I realize it's possilbe to use the '*' character to select all columns in a table, and to use the '%' character to look for patterns in the content of fields to filter rows, but is it possible to use a wildcard character to select mulitple columns with a similar pattern? For example: select t.wtg1* from table t to get all columns with names that begin with 'wtg1'.
Column Names With Special Characters
i'll have to create some columns with special characters in the column names. example: create table PacketFilterLog ( PFlogDate datetime, PFlogTime datetime, SourceAddress varchar(25), DestinationAddress varchar(25), Protocol varchar(8), `Param#1` varchar(8), `Param#2` varchar(8), TcpFlags varchar(255), FilterRule varchar(16), Interface varchar(25), IPHeader varchar(255), Payload varchar(255) ); the proplem resides in: `Param#1` varchar(8), `Param#2` varchar(8), mysql 4.0.16-nt does not accept these column names (and they have to be this way!).
Valid/Invalid Column Names
I'd like to present tabular data in HTML with the first row being the names of the columns in my database. However, I'd like them to be more presentable; for example 'I.P. Address' instead of 'ip_address'. I was wondering if a name like 'I.P. Address' could ever somehow be a valid column name or not.
Using Results From One Table To Populate Column Names In Another
I have a table of gene names. I would like to use this table to populate the column names of a second table (all these columns will be of the same type ie INT(4) to represent expression level). The list of genes is large so I don't want to type in the columns by hand.
Changing Attribute/column Names Once Created.
I've just created my tables in mysql, only I've just realised that one of my table names is wrong and wish to update it. How do I do this? It's easy to update the data in the tables, but I don't know how to change the column names themselves. Will I have to drop the table and start again? Thinking of it, it does solve my problem, but I would still like to know how to update it.
Unknown Column - Variable Names As Strings?
I'm having some trouble inserting records into my DB. The values being written to the database are either the titles of my variables or I get an "unknown column" error. The following is a printout of what's actually getting saved to the database, followed by the values that are supposed to be sent to the database (from form data): Code:
Export/import Of Column Names With Space
I am using MySQL 4.0. Say that I have a table named "mytable" having a column "ID" and a column "test columnname". When dumping: mysqldump --opt DATABASE -uUSER -hHOST -pPASS > myfile.txt it gives someting like: CREATE TABLE mytable(ID int(11) NOT NULL, test columnname text NOT NULL); Then I use the mysql command to import myfile.txt in another database: mysql DATABASE -uUSER -hHOST -pPASS < myfile.txt but it fails with: "ERROR 1064 at line 1: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'test columnname text NOT NULL)' at line 1" Obviously, the mysql command can't handle column names with spaces. Is this a bug? I would say so - mysqldump should put the column names between quotes or so (alternatively, mysql shouldn't allow spaces in column names). My problem is that I have to work with these columns as they are. They're also referred to from a lot of queries in the API's. Any possible workarounds?
Select Column Names With A Regex Pattern
I need to select an unknown number of columns from a dynamically created table. I would like to select only columns based on a pattern such as "%\_1_SCO" or "%\_3_SLH". I could do a select COLUMN_NAMES on the information schema and loop thru creating a prepared statment I suppose but I was hoping for a more elegant solution. What I am thinking is something like this: SELECT (some column name LIKE "%\_SLO"), (some other column LIKE "%\_2_FSR"), etc..FROM someTable;
Column Names With "#"
I migrated a db from Access which has a column name containing a '#'. I would like to rename the column, but I've been unable to do so. It appears that the query browser thinks '#' is the start of a comment. Is there a way to do this?
Populate Table With Database Names Or Table Names
I would like to insert the names of all databases on a server in a table. I know about "show databases", but how can I get it's results into a table? Once I know how to do this, I think I will be able to figure out how to do a similar thing with all tables in a database, and with all fields in a table.
Complex Using Like
I have a bad situation in using like i wana make a like statment that get the all records which start with char. or number , A-Z and 0-9.. do I have to write 36 or in my query or there is another way ???
Complex SQL
I'm using MySQL 3.23 (and no they won't let me upgrade). I have a table which has data for all the actions related to our cases. I need to construct a SQL query to find the most recent action of each type for a certain case. I've tried the following select ID, actn_type, date1, result from actions where case_no = "12345" This of course returned all of the actions. I only want one for each actn_type so I tried select ID, actn_type, date1, result from actions where case_no = "12345" group by actn_type This sorta worked in that I now got only one result for each actn_type, but it selected the ID and date1 from the oldest record. So I tried select ID, actn_type, date1, result from actions where case_no = "12345" order by date 1 group by actn_type I got some annoying syntax error, it wants the order by clause after the group by But when I did that I still got the same results as the previous query. I also tried order by date 1 ASC and DESC but that only changed the order of the results instead of giving me the result I want. At this point I think I'm on the totally wrong track and might have to just resort to sending a number of queries to the database to get the results I want. Just to recap, I need a query that will select ID, actn_type, date1, result for a specific case_no where I only get one record for each actn_type that exists and I get the most recent date1, ID, result for each actn_type.
Complex Statement
Hopefully you guys can help me out on this: the language is PHP, the database is MySQL Here is my PHP function getBounces($start,$end) { $profilecode = $this->PROFILECODE; $sql = "SELECT DISTINCT(sessionid) FROM `profiles_d` WHERE profilecode='".$profilecode."' AND tstamp >= ".$start." AND tstamp <= ".$end." ORDER BY sessionid ASC"; $query = mysql_query($sql, $this->DATABASE); $bouncers = 0; while($rs = mysql_fetch_assoc($query)) { $q2_sql = "SELECT * FROM profiles_d WHERE profilecode='".$profilecode."' AND sessionid='".$rs['sessionid']."' AND tstamp >= ".$start." AND tstamp <= ".$end." ORDER BY tstamp ASC"; $q2 = mysql_query($q2_sql, $this->DATABASE); if(mysql_num_rows($q2)==1) { $rs2 = mysql_fetch_assoc($q2); if($rs2['curpage']=="/index.html") { $bouncers++; } } } return $bouncers; } Little bit of background.. there is a table called: profiles_d in it is a record for each page hit. it has a sessionid and a page name. What I need is the number of sessions that only have 1 page hit for a given date. So if viewer 1 had 20 page hits, there would be 20 records in the database. it's part of a analytics system... From that, I use temp tables and clean it up to 1 record per session.... Is there a way to do that calc in ONE sql statement?
Need Help With Complex Query
i've got 2 tables TABLE 1 contain a list of color with field color_id, title, description TABLE 2 contain connection between different color ex: colorA | colorB 1 - - - - 2 1 - - - - 8 1 - - - - 9 2 - - - - 3 8 - - - - 6 8 - - - - 7 what I want is to be able to list all ColorB for a specific ColorA, but ordered by the most connection from all colorB ..... so if I list connection for colorA #1 it should give me 8 2 9 as 8 have 2 colorB, 2 have 1colorA and 9 have no colorB at all! Is there a way to do this in 1 query?
Complex SQL Query
Hi every1. In my domain I have two kinds of objects: Software and Enumerate. It is many-to-many relationship between Software and Enumerate objects. I use mysql database to store them. So I created 3 tables: software, enumerates and soft_to_enum to hold relationships between objects. software ------------- id name char(255) developer char(255) enumerates --------------- id type char(255) name char(255) soft_to_enum ------------------- soft_id enum_id I have no problem inserting and updating this kind of relationship. But when it comes to selecting, I feel confused. I want to select software objects which links to at least 3 enumerate objects with a type equal to string ‘os’. I write this SQL statement: SELECT s.id, s.name, s.developer, s2e.soft_id, s2e.enum_id, e.id, e.type, e.name FROM software s INNER JOIN soft_to_enum s2e ON s2e.soft _id = s.id INNER JOIN enumerates e ON s2e.enum _id = e.id WHERE e.type =’os’ GROUP BY s.id HAVING count(s.id)>3; It seems to be working. In a result I got several software objects, along with software name and software developer name. And I got column values for only one enum record. But the problem is that I want to load all the enum records, not only one, connected to selected software record. How can I make this by only one SQL call?
Help With Complex (I Think) Query Please
I am building a site with PHP and MySQL. I am writing a function to get data from a table, but I need to select distinct rows from within distinct rows, and more. The function I have written so far contains about three queries, and the way I see it, that is jut not good enough. I know this is not the PHP forum, but I am looking for help on writing a query which will incorporate all three, to save server load, and time - the fabled "let MySQL do all the work". Basically, I have a table of various client jobs. Each record has a unique id, as well as a numeric project_id, used to group records from the same job together. At the same time, each record has a job type (varchar) This could be "installation", "brochure", "website" etc. So, each project is made up of various job types. I need to select the distinct project_id, thus grouping all work from the same project together, at the same time, I need to select distinct job types from within each project. We could have two websites done in the same project, yet, I do not want to display "websites" twice on my page. There is also a client_id field and a client lookup table ("clients") I also need to join this table with the corresponding record in the clients table to get the client name. I am not sure if I have explained to well, but here is my PHP code to try and show what I am trying to achieve. PHP function showRecentWork($limit){ // get the projects from client_work table $s_getWork = "SELECT DISTINCT * FROM client_work GROUP BY project_id ORDER BY project_date DESC LIMIT ".$limit; $q_getwork = mysql_query($s_getWork); $numjobs = mysql_num_rows($q_getwork); while($recent_work_item = mysql_fetch_array($q_getwork)) { // get the client id $project_id = $recent_work_item['client_id']; // get the project id $project_id = $recent_work_item['project_id']; // get the various job types for this particular project $s_getjobtype = "SELECT DISTINCT * FROM client_work WHERE project_id=".$project_id ." GROUP BY job_type"; $q_getjobtype = mysql_query($s_getjobtype); $num_jobtypes = mysql_num_rows($q_getjobtype); // build the list of job types while($this_jobtype = mysql_fetch_array($q_getjobtype)) { $thistype = $this_jobtype['job_type']; $job_type .= " <a href="/work/".$thistype.".php">".$thistype."</a>"; } // get the client name from the clients table $s_getclient = "SELECT * FROM clients WHERE id=".$clientId; $q_getclient = mysql_query($s_getclient); $r_getclient = mysql_fetch_array($q_getclient); $client_name = $r_getclient['client_name']; .... //Print out all the data }}
Complex Query
i have 3 tables : AUDIT SHOP PAGE The audit contains actions of what a site manager does : _____________________________ |AUDIT_ID|TYPE|ADMINISTRATOR_ID|LINK_ID The Audit_ID IS THE PRIMARY KEY TYPE will be EITHER SHOP or PAGE I want a query which will retrieve the details of the audit table and the matching record from either shop or page depending on what type is. The matching record in either the SHOP or PAGE table is found by AUDIT.LINK_ID. So AUDIT.LINK_ID WILL = either SHOP.SHOP_ID or PAGE.PAGE_ID. So if TYPE = SHOP i would want * FROM SHOP WHERE SHOP.SHOP_ID = AUDIT.LINK_ID. But if TYPE = PAGE then the query would be * FROM PAGE WHERE PAGE.PAGE_ID = 'AUDIT.LINK_ID.
Complex Query
I have an odd problem with my database. Well, here are the results from the query Link Tag -------------------------- www.cool.com cool www.cool.com Rad www.cool.com Bad www.mysite.com Clothes www.mysite.com Hair SELECT table1.Link,table2.Tag FROM table1 inner join table2 on table1.id=table2.linkkey I am trying to print the link and then print all the tags that belong to it and it will go to the next link then print all the tags that belong to that link. Also, is their a way to use Limit on table1 with this type of query?
Complex MySQL/PHP
I have a MySQL/PHP project where I need to assign a Red (R) or Blue (B) store coupon to randomly selected contest winners. There are 2 tables (winners, stores). Each store has a region_code and contest winners also have region_code for where they live (both are CHAR(3). Here's where it gets tricky. Each store can only give out 3 coupons (either 3 Red or 3 Blue). Additionally, the winners location (winners.region_code) should be assigned a store coupon from the same region (stores.region_code), until the matches run out, and leftover coupons are assigned to winners that live anywhere. After all this, I'll write the final results to a table. I can randomly select correct # of winners, and display them in a repeat region just fine. However, I'm unsure about the logic behind assigning data from the stores table to those results, and how to iterate through and 'stop' assigning coupons from each store after 3 coupons. Not sure if this requires some sort of 'view'. Not looking to get out easy, just for some advice on how I should go about this.
Need Help With Complex Query
I have a single table with 11000 rows. Table has a field named journals, and one named ISSN. The journals field only contains 1 of 5 possible values: Sociology, Criminal Justice, etc. I need to find identicals, distinct to one, or distinct to the other, ISSN's when comparing any two sets of journals. So, for example, if my visitor wants to compare Sociology to Criminal Justice, I select ISSN where journals = Sociology and where journals = Criminal Justice. Now, sometimes they want to know which ISSN's are identical between the two, which are only in Sociology, and which are only in Criminal Justice. I hope that makes sense. I don't know how to create select statements that will grab the ones I want, and allow me to sort based on any of the fields in the rows.
Complex UPDATE -
Here is code, that runs well on PostgreSQL and MS SQL Server: update TTable set summ=(select Count(1) from TTable t2 where t2.mybool=TTable.mybool); This means that each record (lets name it 'A') in TTable will have field summ filled with the number of the records in this table where the value of mybool field is the same as it is for record A. MySQL returns error 1093.....
Complex Joins
Here is the problem. Table_1 (gl_Train_KeyIdeas) +----------------------+----------------+-------------------+---------------+ | KeyIdea_ID | Unit_ID | Group_ID | Title | +----------------------+----------------+-------------------+---------------+ | 1 | 1 | 27 | yada 1 | | | | | | | 2 | 1 | 27 | yada 2 | | | | | | | 3 | 1 | 27 | yada 3 | | | | | | | 4 | 1 | 27 | yada 4 | | | | | | +----------------------+----------------+-------------------+----------------+ Table_2 (gl_Train_Progress) +----------------------+----------------+----------------------+ | ID | User_ID | KeyIdea_ID | +----------------------+----------------+----------------------+ | 12 | 5 | 3 | | | | | | 11 | 5 | 2 | | | | | | 10 | 5 | 1 | | | | | +----------------------+----------------+-----------------------+ The following sql returns field KeyIdea_ID = 4 which is the only KeyIdea not in both tables. SELECT gl_Train_KeyIdeas.KeyIdea_ID FROM gl_Train_KeyIdeas LEFT JOIN gl_Train_Progress ON gl_Train_KeyIdeas.KeyIdea_ID = gl_Train_Progress.KeyIdea_ID WHERE (((gl_Train_Progress.KeyIdea_ID) Is Null) AND ((gl_Train_KeyIdeas.Unit_ID)=1)); What I seem to be having trouble with is specifying the User_ID in table 2. I need to specify the current user for example: an sql with a User_ID = 6 would return KeyIdea_ID of 1, 2, 3, and 4.
Complex Ordering
I would like to order query results by a numeric column containing positive numbers and zeros at a descending order, except that results with a zero 0 should appear last (e.g.: 2, 10, 15, 16, 0). Can I do that in a single query, or do I need to use to successive queries or order my results in the programs that receives them before displaying them?
Complex Select
This is something I need to do with one select. Here is my select: SELECT SUM(value1) FROM mytable WHERE rec_time BETWEEN '00:00:00' AND '00:30:00' AND YEAR(rec_date) = YEAR(NOW()) GROUP BY MONTH(rec_date) or SELECT SUM(value1) FROM mytable WHERE rec_time BETWEEN '00:00:00' AND '00:30:00' AND YEAR(rec_date) = YEAR(NOW()) GROUP BY LEFT(rec_date,7) rec_time = time rec_date = date as you can see, I'm collecting summary of daily record around midnight and building an monthly array like: 0,0,0,6.5,0,23.7,2,0,0,5.5,0,0 BUT! my function call requires a constant-length list. So if any months in my selection range have no data, I need to fill the space with an empy value. How can I do this? Perhaps with an helper table, but how?
Complex Index
I am trying to find out if there is any way of creating a complex index on a table. My data sample is: a bird can be banded once (coded as '1') the bird can be retrapped many times (coded as '2') the bird is recovered dead once (coded as 'X') How can I create a code that allows codes '1' and 'X' only once, but code '2' infinate times? I currently have a index on Band number, date and code. But this allows multiple code '1's if the dates are different. A uniue index on only the band number and code does not allow multiple code '2's Seperating the data into different tables is not an option, so currently I am doing the checks via a VB front-end. This is slow and cumbersome. I need a way to do this more efficiently.
Complex Select
This is something I need to do with one select. Here is my select: SELECT SUM(value1) FROM mytable WHERE rec_time BETWEEN '00:00:00' AND '00:30:00' AND YEAR(rec_date) = YEAR(NOW()) GROUP BY MONTH(rec_date) or SELECT SUM(value1) FROM mytable WHERE rec_time BETWEEN '00:00:00' AND '00:30:00' AND YEAR(rec_date) = YEAR(NOW()) GROUP BY LEFT(rec_date,7) rec_time = time rec_date = date as you can see, I'm collecting summary of daily record around midnight and building an monthly array like: 0,0,0,6.5,0,23.7,2,0,0,5.5,0,0 BUT! my function call requires a constant-length list. So if any months in my selection range have no data, I need to fill the space with an empy value. How can I do this? Perhaps with an helper table, but how?
Complex Select
I have a table with 6 fields: id, project, section, division, subdivision, title. Data like: 0 10 1 1 1 'Title111' 1 10 1 1 2 'Title112' 2 10 1 2 1 'Title121' 3 10 1 2 2 'Title122' 4 10 1 3 1 'Title131' 5 15 1 1 1 'Title111' 6 15 1 1 2 'Title112' 7 15 1 1 3 'Title113' 8 15 1 2 1 'Title111' 9 15 1 2 2 'Title112' As you can see project 10 has: 4 10 1 3 1 'Title131' and project 15 has: 7 15 1 1 3 'Title113' And there are 4 records that match section, division, subdivision and title in each project. 1 1 1 'Title111' 1 1 2 'Title112' 1 2 1 'Title121' 1 2 2 'Title122' I am looking for a select that will give me the following data: 1 1 1 'Title111' 1 1 2 'Title112' 1 1 3 'Title113' 1 2 1 'Title121' 1 2 2 'Title122' 1 3 1 'Title131' Basically, I want all records from both projects but only 1 of the records that have similar data.
|