|
Hi,
I have a rather specific query -
I want to be able to retrieve data from a database, display it in a DataGridView and allow the user to filter columns by inputting simple filter queries above each column.
For example:-
| Foo | Bar | Baz | | Filters...
Started by kronoz on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Of time to explain everything that's involved, but there's a really great article from Microsoft/system.data.dataview.rowfilter.aspx
I've found a very useful project which allows per-column intuitive filtering.
|
|
I have a text file which is:
ABC 50 DEF 70 XYZ 20 DEF 100 MNP 60 ABC 30
I want an output which sums up individual values and shows them as a result. For example, total of all ABC values in the file are (50 + 30 = 80) and DEF is (100 + 70 = 170). So the...
Started by Sam on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
My %data; while (<>) { if (my ($key, $value) = /^(\w+) \s* (\d+)$/x) {... .
Awk '{sums[$1] += $2} END { for (i in sums) printf("%s %s\n", i, sums[i])}' input_file | sort
if you don't need the results sorted alphabetically, just drop the | sort part .
|
|
I've got (for example) an index:
CREATE INDEX someIndex ON orders (customer, date);
Does this index only accelerate queries where customer and date are used or does it accelerate queries for a single-column like this too?
SELECT * FROM orders WHERE customer...
Started by Georg on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
In that case, you might need to create a second index on just the date to make those... .
A date range.
However, this index doesn't help you if you need to select on just the date, e.g .
I'm pretty sure this will work, yes - it does in MS SQL Server anyway .
|
Ask your Facebook Friends
|
I'm new to database indexing, if I have 2 columns in a table that are good choices for indexing like for example,
[Posts]( [PostID] [int] IDENTITY(1,1) NOT NULL, [UserName] [nvarchar](64) NOT NULL, [ApplicationType] [smallint] NOT NULL, ... )
in this ...
Started by ray247 on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
In the end, you could have all 3 indexes (one composite, 2 single column that with the multi-column....
Indexes are great if you're searching on the first column named in the index, and optionally the second for each is appropriate.
|
|
If I have an table
create table sv ( id integer, data text )
and an index:
create index myindex_idx on sv (id,text)
would this still be usefull if I did a query
select * from sv where id = 10
My reason for asking is that i'm looking through a set of tables...
Started by svrist on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Usefully leverage an index skip scan if the leading column is of very low cardinality, or a fast full it is likely that you would do better to create an index with col2 as the leading column); create bitmap index ix_mytable_col3 on mytable....
|
|
Disclaimer: I'm an SQL newb, just discovering the great possibilities of sqlite embedded in applications.
I'm designing a small database for an application that primarily handles data storage for plotting. Say I have several instrument data tables (one...
Started by bobasaurus on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
(There are exceptions to this, such as....
Since the human-readable column name is a display detail, and likely a static value.
There are ways to do introspection in SQL and pull out table and column names, but you probably particular RDBMS.
|
|
First off, I'm a Paradox newbie.
Secondly, I'm querying a database of a third-party software package and cannot change the schema.
I have two fields simply named "Date" and "Time" that I'd like to query as a DateTime (from my MS SQL experience).
Is this...
Started by Austin Salonen on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
SELECT CAST(CAST(f.DateColumn AS VARCHAR(20)) + ' ' + CAST(f.TimeColumn AS VARCHAR(20)) AS TIMESTAMP) As FooTime FROM... .
SELECT CAST(f.DateColumn AS VARCHAR(20)) + ' ' + CAST(f.TimeColumn AS VARCHAR(20)) FROM Foo f
That gives you the concatenated string .
|
|
Is there any way of adding custom text in an computed column?
For example this formula works great ([Duration] + '12')
Could i have a result, from a computed column, similar to this one?
([Duration] & ' MyCustomText')
Can i add custom text in a computed...
Started by strakastroukas on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You just can't use column values from other tables...
Sure, when you define a computed column, you can write any expression that the server can evaluate using the values in that table ..
|
|
Hello. Is it possible to rename a column using a command like:
script/generate migration AddColumnToTable column:type
? Thanks.
Started by Victor P on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Example (MySQL....
You can generate a migration and then write the code yourself .
See Rails 2.3.5 source code:
lib/rails_generator on the ActiveRecord ConnectionAdapter called rename_column .
The answer is, unfortunately, no.
Great question.
|
|
I need to alter the length of a column "column_length" in say more than 500 tables and the tables might have no of records ranging from 10 records to 3 or 4 million records.
1) The column may just be a normal column *create table test(column_length varchar...
Answer Snippets (Read the full thread at stackoverflow):
Likely you will need to do alter column on the foreign key tables.
The index and primary key in place.
|