Hi I have a table with all numeric values inserted in column 1, column 2, column 3.....
I know how to find the most repeated two values from one column but our goal is to find the most repeated two from all tables. Could you help provide any quicker thoughts?
I have a table which contains columns with multiple values(comma separated).How to fetch data based on a single value from these columns.Using mysql as DBMS
I have a big database and I do not know the tables name and columns of a value 11601 which is stored in the Database. Is it possible to show the tables and columns with this values 11601?
I have to large tables, a main one (TableA) with around 14 million records and a second one I want to merge into it with 20 million records (TableB). For the most part the first is a subset of the second.
I tried making a Unique Index using 2 or 3 fields combined that would identify records as such but MySql wouldn't do it.
I then made my own field 'Unique' by concatenating those three fields.
My question is how do I an import TableB into TableA using only unique records i.e. ones where the value in Unique field in TableB does not already exist in Unique field in TableA. Since I could not make the Unique field an actual unique index will/should I try to make each one a PK and or ordinary index in the respective tables?
Any thoughts on how to do this efficiently appreciated.
Use the sql union statement.
"select * from tableA join tableb"
I am working with BDS 2006,MySQL DB (MyDAC components used for connection) and i have a DBGrid component on my form which displays the records from my DB table.
Now i need to JOIN two tables and display the results in my DBGrid
The Resulting view that I should get is the result of the query
SELECT e_salary.e_basic,e_details.e_name
FROM e_details
INNER JOIN e_salary
ON e_details.e_id=e_salary.e_id;
there is one more option to do it as I searched
SELECT
e_salary.e_basic,e_details.e_name
FROM
e_details, e_salary
WHERE
e_details.e_id=e_salary.e_id;
e_details,e_salary are my two tables and e_id is my PRIMARY KEY
Presently I am having 2 DBGrid one is for e_details and other for e_salary
Is it possible to have only 1 DBGrid displaying values from both the Tables? or I have to display 2 separate DBGrid?
If possible then how do I go about it
P.S.- there are more columns to be added in the view and both tables have same no of rows
Thanks in advance
DBGrid displays a dataset data. The data may be result of some SQL query execution. DBGrid, TDataSet and TDataSource do not cary what was the SQL query. Single table SELECT, multi table SELECT with joins, stored procedure call or SHOW command. So, yes - you can use 1 DBGrid to display resultset of your SELECT joining 2 tables.
If both tables have the same number of rows, e_id is primary key for both tables, then why not to have single table, containing columns of both tables ? Also, if you will need to edit your dataset data, then there may be problems to update columns of both tables. And that may be one more argument to have single table.
Although you can use WHERE e_details.e_id=e_salary.e_id instead of JOIN e_salary ON e_details.e_id=e_salary.e_id. The JOIN is preferred, because DBMS gets your intent more explicitly and that is more readable for others.
The DBgrid is probably not the component you need.
Give an eye to the TTreeView
http://delphi.about.com/od/vclusing/l/aa060603a.htm