query

SQL Query to retrieve results from two equally designed tables

How can I query the results of two equally designed tables? if table1 contains 1 column with data: abc def hjj and table2 contains 1 column with data: uyy iuu pol then i want my query to return abc def hjj uyy iuu pol but I want to make sure that if I try to do the same task with multiple columns that the associations ...

I want to store date in my database table in dd/mm/yy format & perform order by on that column.

I want to store date in my database table in dd/mm/yy format & perform order by on that column. Please help. ...

A cumbersome linq query

I have the following setup: Tasks, Accounts and Groups tables. Tasks can be assigned to both individual accounts and groups. I've made two supporting tables: TasksAndAccounts and AccountsInGroups. TasksAndAccounts table has the following fields: TaskId, AccountId, GroupId and AccountsInGroups has AccountId and GroupId fields. I'm trying ...

How do I get a list of locked users in an Oracle database?

I want to be able to list all of the users in a given database along with an icon that determines whether they are locked or not. The problem I'm having is querying the "locked" status for a given user, I though it might have been on all_users but it isn't. Can anyone point me in the right direction? ...

Where can i see the query generated by subsonic?

I need to see how subsonic generates the SQL Query string. ...

Subsonic: How to exclude a table column so that its not included in the generated SQL query

I need to insert a record to a table. Subsonic builds the query something like this (as far as i know): INSERT INTO Table1 (Title, Description, RowVersion) VALUES (@Title, @Description, @RowVersion) But i want to remove the RowVersion column from the SQL query bacause its autogenerated by the sql server. How can i do that? ...

store and query xml data in MySQL

what are the good options to store xml structured data and query the data in MySQL? I know from mysql5.1.5 there is a function ExtractValue() to query the data directly, but due to certain limitations I can only use mysql5.0.x. what I need is to store the data in simple xml format, such as <person> <name>My Name</name> <gender>male</ge...

Lucene query - "Match exactly one of x, y, z"

I have a Lucene index that contains documents that have a "type" field, this field can be one of three values "article", "forum" or "blog". I want the user to be able to search within these types (there is a checkbox for each document type) How do I create a Lucene query dependent on which types the user has selected? A couple of prere...

SQL Query Duplicate Removal Help

I need to remove semi duplicate records from the following table ID PID SCORE 1 1 50 2 33 20 3 1 90 4 5 55 5 7 11 6 22 34 For any duplicate PID's that exist I want to remove the lowest scoring record. In the example above ID 1 would be remove. I'm tr...

mysql if condition

in my query i have IF(friend.block, 'yes', 'no') and friend.block value is 0 or 1.. but eaither way its putting 'yes'.. any idea? ...

How to Get SQL Server Database performance Information?

Are there any standard queries that can be run that will show the performance of a SQL Server 2005 database? Note: I need to know the performance of every aspect of the database. EDIT: I am looking for a way to measure the time it takes for typical queries to execute. I am then going to apply indexing to certain tables in the database ...

Cross-database queries with numbered database name

Hi there, I'm a bit of a novice when it comes to SQL Server 2005. I have a database containing most of the stored procedures and tables (we'll call it 'GrandDatabase'). Each user has its own separate database named after the user's numbered ID. So I have a database list as follows, for example: GrandDatabase 100 101 102 ... I need ...

Using backquote/backticks for mysql queries

Hi, I've been having a dilemma for a while now, so I said I'd see what you guys thing before I rest my case. Ever since I started playing with MySQL I was building query how I though was "the right way", with backticks. Example: SELECT `title` FROM `table` WHERE ( `id` = 3 ) As opposed to: SELECT title FROM table WHERE ( id = 3 ) ...

ms access complicated query. querying last two entries by date for each ID. very slow

I have two tables. Widgets, which has information about each widget (Color, size, etc); each widget has a unique ID, WidgetID. The other table is Tests, and it contains information about multiple tests that were run on each widget. This table, therefore, has multiple rows for each WidgetID. It contains information that we can call (Widg...

query a table not in normal 3rd form

Hi I have a table which was designed by a lazy developer who did not created it in 3rd normal form. He saved the arrays in the table instead of using MM relation . And the application is running so I can not change the database schema. I need to query the table like this: SELECT * FROM myTable WHERE usergroup = 20 where usergroup fiel...

how twitter passes query variables?

I notice that when I browse pages in Twitter. Instead of having some like twitter.com/home.php?var1=2&asjfaj...etc. (the most common way), the link is just Twitter.com/#home or twitter.com/inbox or twitter.com/followers. my guess is, they use sessions variables to pass information across pages/ links. is it a good way to do it? w...

Firefox adds two new line characters for the radio button list selected value in asp.net

Hi, I have a asp.net web page with a drop down list (RadioButtonList), one of the list item in that list is long text so it wraps to the next line (the list is nested inside a table). I have a auto post back enabled for the list and i handle selection change event. Now if I select that list item with the long text, the selection change e...

How to make complex contains queries in Django?

Hi, I need to make query like this: WHERE Comment like '%ev% 3628%' or Comment like '%ew% 3628%' the number '3628' is a parametr. So I've tried in my view: First try: wherestr = "Comment like '%%ev%% %s%%' or Comment like '%%ew%% %s%%'" % (rev_number, rev_number) comment_o = Issuecomments.objects.extra(where=[wherestr]) ...

How can I query from two tables but get results only from one?

I have list of contacts and then I have list of blocked contacts. I need to query contacts that are not blocked. How can I make query where all blocked contacts are filtered out inside the sql query? ...

sql Query in VBA code

If I want to code the following in VBA how do I do it QUERY1: SELECT field1, Min(field4) AS MinField4, Max(field5) AS MaxField5 FROM Table1 GROUP BY field1; SELECT Query1.field1, Table1.field2, Table1.field3, Query1.MinField4, Query1.MaxField5 FROM Query1 INNER JOIN Table1 ON (Query1.field1 = Table1.field1) AND (Query1...