multiple-tables

How do I use full text search accross multiple tables, SQL Server 2005

I have a full text catalog with two tables in it. tableA has 4 columns (a1, a2, a3, a4) of wich 3 are indexed in the catalog, a2,a3,a4. a1 is the primary key. tableB has 3 columns (b1, b2, b3, b4), two of which are indexed in the catalog, b3 and b4. b1 is the PK of this table, b2 is the FK to tableA. I want to do something like SELE...

Joining 3 tables and retrieve all the records from all the tables

I am joining three tables (performing a full outer join) so that I can retrieve all the records from all the tables. Problem that I am facing is with the order in which I join tables. Table Information (1) If I join tables in TABLE1, TABLE2, TABLE3 sequence I get two rows for record with team B and Level 1. SELECT DISTINCT (CAS...

Selecting multiple values different tables

Hi, I'm relatively new to MySql. I have 2 tabled with the following structure products { pid-autoincrement, pname p_desc } services { sid-autoincrement s_name s_desc } Im trying to select the products or services which have the name '%<somekeyword>%' I'm using the query: SELECT DISTINCT products.*, services.* ...

insert data in multiple tables

hi i have a problem to insert data in multiple tables. i have define primary key & reference key in tables now i want to insert data in both tables in single query.......how can i do this...........??????? ...

MVC Entity Model not showing my table

I have a database with multiple tables, and some basic relationships. Here is an example of the problem I am having: My Database: **Org** ID Name etc **Detail1** ID D1name **Org_Detail1** Org_ID Detail1_ID **Detail2** ID D2Name **Org_Detail2** Org_ID Detial1_ID BooleanField My problem is, the Org_detail1 table is not showing up ...

MySQL and faceted navigation (filter by attributes)

Hi, I feel like this question has probably been asked a thousand times already, so I apologize if it's been answered. And if so, can someone point me to the right posts/links? What I'm trying to do is build a faceted navigation for my site. It uses MySQL and here's a rough sketch of the tables I'm using: products: - id - title - descr...

MySQL: splitting one table to multiple tables (same columns) for performace increase?

This question is about performance, not about possible solutions. My system holds many items of different categories. Each category has its own table since each table has many rows AND the fields are different. ItemA - id, fld1, fld2 ItemB - id, fld1, fld3, fld4 ItemC - id, fld1, fld3, fld5 .... Now there's a need to manage user inve...

How can I have two columns in one table point to the same column in another with ActiveRecord?

I run the risk of palm-to-forehead here, but I can't quite figure out how to do this with Rails' ActiveRecord sugar. I have a tickets table that has two columns (submitter_id and assignee_id) that should each reference a different user from the users table (specifically the id column in the users table). I'd like to be able to do things...

Search in multiple tables with Full-Text

Hi, I'm trying to make a detailed search with asp and SQL Server Full-text. When a keyword submitted, I need to search in multiple tables. For example, Table - Members member_id contact_name Table - Education member_id school_name My query; select mem.member_id, mem.contact_name, edu.member_id, edu.school_name from Members me...

mysql not in or value=0?

Database one is called widgets, it has "id" and "title". Database two is called widget-layouts and it has "module-id", "widget-id", "position", and "weight". What I am trying to do is check to see if widgets.id exists in widget-layout.widget-id and if it does, then does widget-layouts.position = 0. I also want to get the values of widge...

banner advertising mysql-query with multiple tables

Hello. My problem is described further under the table structure. This is my tables for my advertising banner system: banner id (unique key) title bannersrc maxhits maxklik activefrom activeuntil dato bannerhits (number of shows) id (unique key) ip bannerid (index) (referring to banner.id) dato bannerklik (number of click...

Select, where id = multiple from other select

I'm tired and I can't wrap my head around this. I have two tables: table menu @id = id, @nr = id of parent |======|======| | id | nr | |======|======| | 10 | 9 | | 11 | 10 | | 12 | 10 | | 13 | 10 | |======|======| table content @id = id, @mf = menu - first in tree, @mi = menu item linked to content |======|======...

SELECT limiting to only results based on a CSV list from a separate table

So I have a list of CSVs in one table. (EG: 1,3,19 ) I want to search out all of the usernames from the other table where the ids match any of those. I feel like I should be able to do something like: <? $query = "SELECT player_ids FROM cast_list WHERE game='".$gameid."' "; $result = mysql_query($query) or die(mysql_error()); $player...

Linq to SQL: How can I update a formview that has data from multiple tables?

Take a simple example: I have a customer table and an account table both with customerID field. I want to formview that can update data in both tables. FormView: First Name (Customer) Last Name (Customer) Address (Customer) AccountRate (Account) How can I do this with Linq to SQL? Do I just use Bind statements like Bind("Account.A...

mysql select with multiple tables and flexible output

Hi i got a mysql-select about three tables, where each tables have different fields. One may have the field "title", the other may not but have the field "location". Now i want to have a common output of these three tables, and each row is supposed to have a title. for tables, whoch have the field "title" in the output the title should c...

Postgres full text search across multiple related tables

This may be a very simplistic question, so apologies in advance, but I am very new to database usage. I'd like to have Postgres run its full text search across multiple joined tables. Imagine something like a model User, with related models UserProfile and UserInfo. The search would only be for Users, but would include information fro...

Doctrine expand extended model using column aggregation

Techniques: ORM, Doctrine 1.1.6, KohanaPHP With Doctrine 1.1.6. How do I spread a model over different tables? Detailed situation: I have the class Entity which contains an ID, login and password and has one emailaddress, many addresses and some other relations. I have two other classes, Company and Person, which extend Entity. I want...

how can i bind data in radio button list?

how can i bind data in radio button list? ...

MySQL multi table queries

Hi community. I have a bunch of data ordered by date and each table holds only one month of data. (The reason for this is to cut down query time, I'm talking about millions of rows in each month table) For ex. data_01_2010 holds data from 2010-01-01 to 2010-01-31 data_02_2010 holds data from 2010-02-01 to 2010-02-28 Sometimes I hav...

mysql problem left join and from_unixtime

I have this SELECT COUNT(1) cnt, a.auther_id FROM `posts` a LEFT JOIN users u ON a.auther_id = u.id GROUP BY a.auther_id ORDER BY cnt DESC LIMIT 20 It works fine, but now I want select posts from within the last day. I tried to use WHERE from_unixtime(post_time) >= SUBDATE(NOW(),1) but it didn't work. Any...