query

nhibernate: query criteria for an entity and possibly a subclass in the same query

This is the setup for my 2 entities: public class Person { public Guid Id {get;set;} public string Name {get;set;} } public class Immortal : Person { public string DarkName {get;set;} } Here's what their mapping looks like: <class name="Person"> <id name="Id"> <generator class="guid.comb"/> </id> <property name="Name...

PHP - problem with nested mysql_fetch_array() driving me crazy

The MySQL query: SELECT title,alias,parent FROM '._prefix.'categories WHERE (language = \''._language.'\' || language = \'all\') && status = \'published\' ORDER BY rank ASC The Result (from phpMyAdmin): title | alias | parent Home | home | 0 Todo | todo | 0 Multiuser| todo_mu | 21 Modulsys | todo_mo...

MySQL fulltext query: search:ipod (DONT want tripod) but search:dg43nb (DO want box43nb)

Heya I need help with my MySQL product search query. Overall I'd appreciate any critique / tweak suggestions, more importantly though I have an issue.. I implemented this to stop people searching: "ipod" & getting "tripod" at the top of the list.. now my issue.. search for "dg43nb" I get 0 results but should get title:"BOXd43nb" So ...

exclude from union by only one out field ...

SELECT A.ID_ListGroupParIzm, A.Name, 0 AS Point FROM CfgListGroupParIzm A, CfgIzmeritel B WHERE A.ID_TypeIzmerit = B.ID_TypeIzmerit AND B.ID_Izmerit=@ID_Izmerit AND A.ForRun=0 UNION SELECT A.ID_ListGroupParIzm, (C.Name + ' ' + A.Name) AS Name, C.ID_IzmerPoint AS Point FROM CfgListGroupParIzm A, CfgIzmeritel B, CfgIzmerPoint ...

Using query to retreive records which their createdate is a special date?

I have a table that has four columns. One of them is named "CreateDate" and it's datatype is "DateTime". Now, what would be a true T-SQL which retreives records that their CreateDate is for example "2010-02-10" ? ...

insert if not exists else just select in mysql

I have one mysql table 'alfa' that will contain the primary key of another table 'beta' in one column. But if the entry in 'beta' can not be found I want to insert the value in 'beta' and use the new key in 'alfa'. Can I do this in one query somehow ? I currently have: INSERT INTO alfa SET c1=(SELECT id FROM beta WHERE name = 'john'); ...

how to analyze Query CPU time

Hello, How can I analyze the CPU time consumed by my Innodb queries? I have innotop, but I cant seems to find where it is. Thanks. ...

When exactly are PHP-MySQL variable assignments made?

[Status: learner] Using checkboxes, the user selects rows from a displayed HTML table. I then want to insert the date and the unique row id ("select_id") of the selected ('ticked') rows into a different table. Maybe I'm off-base, but it seems to me that the first block of code does not work. The second block of code does work. If I'...

Write Queries on Excel sheet in c#

I want to update specific row of excel sheet from my asp.net application. I m able to read excel, but how can i update the records.Can i write Update query . How . please send me code: string strQuery = "UPDATE [Sheet1$] SET Child Name=" + "\"" + strDataToUpdate[0] + "\","; strQuery = strQuery + "Pickup Point Name=" + "...

Make a fake schedule if it doesn't exist in db

I want to pull all the rows from a database for a month and if there are any rows in the beginning or in the end that are missing then I want to create fake rows, so every day there is a schedule that one has to follow. How can I detect missing rows or how can I solve this issue? ...

EORROR : Near Keyword SELECT on 6 line

set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[FlowClientGetCatWeb] (@ID_Izmerit Integer, @ID_User Integer, @APP bit) AS SELECT Name, (CAST(ID_ListGroupParIzm AS nvarchar(10))+'_'+CAST(Point AS nvarchar(10))) AS GroupPoint FROM SELECT ID_ListGroupParIzm, Name, Point FROM FlowClientGetCat(@ID_Izmerit,@ID_User,@...

How to filter a table by T_SQL in SQL Server 2005, using a specific time for a column of "DateTime" datatype

hi How to filter a table by T_SQL in SQL Server 2005, using a specific time for a column of "DateTime" datatype? Thank you ...

WordPress execute query

which method we are using for execute query in wordpress ...

Painfully Slow DB2 Query

This query is PAINFULLY slow and our team cannot figure out why. We've tried creating views, but it still extremely slow. Any thoughts? SELECT CI . CWARCASNBR AS CASENUMBER , CI . CT1FYA AS COURTAGENCYCODE , CI . CIPTYSQNBR AS PARTYSEQNBR , CI . CIRCDTYPE AS CASETYPECODE , CP . NMELASTBUS AS LASTNAME , CP...

sql query to join 2 tables and show all records from 1 column

i have two tables in sql server - one with 51 american states, and the other with name,state. the table with name state has different records namely - Seere -- AK Seere -- LA Seere -- CA John -- HI John -- MA I want a query that picks up one name say "Seere" and shows all the states from state table, and the name attached to those s...

tricky Oracle analytic function question

Hi all, I'm new to Oracle analytic functions and I'm trying to find the best way to write my query. The following is a simplified version of a table I'm working with... CREATE TABLE my_table ( pid NUMBER NOT NULL, my_value NUMBER, value_date DATE NOT NULL, CONSTRAINT pk_my_table PRIMARY KEY (pid, v...

Sql Query With Select and IF

here is my table description: Table Name : Orders Columns : ID, NO, Quantity, Base, Code First my query should check the value of Code, if value of Code is 'B' then OUTPUT VALUE should be Code+Base if it is not 'B' then OUTPUT VALUE should be Code+Quantity the obtained rows again will be filtered by using where clause where ID='' ...

Classic asp: why doesn't Request.QueryString("foo").toString() work in a javascript (JScript) based page?

All I want to do is Get the name-value pairs that were supplied to Request.QueryString Populate a javascript object (aka hash) with keys from the names and values from the values Halt the page if one of the expected hash values is the empty string The Request.QueryString object is reminding me why I hated classic asp even before it w...

ORDER BY DECODE(BLAH, [COLUMN NUMBER]) on a single column query. How does it work?

Hi I need help to understand the decode part of a query that goes something like the following. SELECT ax.animal_code FROM raw_animal_xref ax, animal_xref_type axt WHERE ax.animal_mnemonic = l_animal_mnemonic -- Example 'COUGAR' AND ax.animal_code_type = axt.animal_code_type ORDER BY DECODE (animal_type, l_...

SQL Server 2005 Error 701 - out of memory

I'm currently having following error message when executing a .sql file with about 26MB on SQL Server 2005: Msg 701, Level 17, State 123 There is insufficient system memory to run this query. I'm working with 4GB RAM, 64Bit Windows 7 Ultimate, Core2Duo T6400(2GHz)... Is there a way to execute it without receiving this message (maybe ...