query

sql query like this please help me to correctly form it thank you

select DISTINCT table0.person_name, table5.animal_name from table1 INNER JOIN table0, table5 on table1.person_id=table0.person_id and table1.animal_id=table5.animal_id where table1.aa=input1 and table1.bb=input2 and table1.cc=input3 and table1.dd=input4 2 base tables, 1...

How to efficiently code a query in mysql to AND tags?

I have a common problem to be sure. I'd like to make a query that finds an entity that has "n" tags. So in the simplest case, we find all the entities that have the tag "hey". In a more complex case, we find all the entities that have all the tags "hey", "hi" and "howdy". It seems that I have to join to the tag table 3 times, and and th...

Microsoft Access - Create a numerical sequence based on field value changes?

For query data like this: Name , Details JEFF , TEST1 JEFF , TEST2 JEFF , TEST3 BOB , TEST1 BOB , TEST2 How do I query so that a numerical sequence (1,2,3...) can be added that resets back to 1 each time the name changes (ie from JEFF to BOB)? Is it possible to use the DCOUNT function? What ...

Spatial Querying Using MapWindowGIS

Hi I am building a GIS application for some organisation and was thinking of using Open Source Software MapWindowGIS....and .Net Framework Can anyone tell me how good it is and will i be able to perform Spatial Query using this ....? How is the help amnd Support if i get stuck in any problem... Thanks & Regards, ...

SingleOrDefault throw exception on more than one element

Im getting error whenever i fetch like this Feature f = o.Features.SingleOrDefault(e => e.vcr_LinkName == PageLink && e.bit_Activate == true); because this can return one or more than one element. so what is the alternative approach that i can use to solve this issue ...

sql selecting from different tables based on boolean

hi, I have a simple stored procedure like so: ALTER PROCEDURE [dbo].[spList_Report] @id INT AS SET NOCOUNT ON SELECT * FROM tblProducts as products WHERE product.intID = @id I have 2 user tables: MainUser and SubUser Both tables have a foreign key column productID which is related to the primary key int...

how to search multiple tags in doctrine

I have a database with many-to-many relations on tag and person. I am in trouble when tried to search a person with multiple tags. I tried this but its fail: $person = Doctrine_Query::create() ->from("Model_Person p") ->innerJoin("p.tags t") ->whereIn('t.id',$t) ->execute(); The above statement ...

linq2sql: how to modify not-mapped entity member in query?

How to modidy entity in query? I have code like this: var res = from p in dc.Folders group p by p.FolderId into gr let DDate = gr.Where(a =>a.status ==5).Max(g=>g.MDate) from c in gr select c; Folder class has extra member not mapped to db called DDDate, just for example. How I can set this memb...

How to implement custom Model Class for Oracles ADF Query Component

I am using Oracle ADF for one of my project and i am using Query component of ADF. For given tables the query component creates view objects and maps the relations. ADF uses its own custom model class for this component and it should understand the DB tables. But for my project i have no access to database. All i can do pass a string or ...

python - recursive call

Hello, I have a class model designed for a person class in python. where a person is a student and can have 0,1 or many advisors.A person can also have other attributes like name,school,year of graduation,classification he worked on,degree he obtained and so on. I have set and get methods for each of these attributes in the class. Ex. ...

Query multiple taxonomies

Hi, I'm modifying a wordpress plugin (Related Posts by Category) to make it instead "Related Posts by Taxonomy". I've created multiple taxonomies (elements, colors, and mood) that I'd like to include in this query, but can only seem to make it work with one taxonomy (elements). The code below only returns related posts that have the same...

SQL Create table script from DBMS contains [ ]

If some one does right click on a given Table in a Database using SQL Server management Studio from Microsoft and create script table to query window, it displays the create table code in the window. I notice something like the following CREATE TABLE [dbo].[Login]( [UserId] [int] NOT NULL, [LoginName] nvarchar COLLATE SQL_Latin...

DL Query Protege with JAVA

hi, I want to create simple application using Java Jena and DL Query,that query the OWL/RDF data I worked on protege to create the ontology. I want to use DL Query using java and jena ... there is an JAVA-API for DL Query? or included in Protege API? what is the advantage of "DL Query" to "SPARQL"? ...

How can I create a large boolean search string from a list of keywords?

Hi, first time here, so please treat me like a fool who knows nothing about anything. I have a very specific problem that i'm trying to find an answer to, and i'm hoping you might find this quite easy... I'm working on a project where we need to create very long boolean queries from lists of keywords (up to 500), and i'm looking for a s...

Grouping fields by category and arranging by date, and calculating from another table

I have a products table, with the fields product, category and cost, of type varchar, varchar and decimal. I then have a sales table, with the fields client, productname, quantity, cost, and saledate, of type varchar, varchar, int, decimal and date. I also have a purchases table, with the fields purchasedate, cost, quantity and purchas...

Can i get entity filled via Entity SQL ?

Hi. Can i do something like that: I got some entity Customer with Id, Name, Comment Now i want to get this entity from context with filled id and Name and Comment must be empty. I don't want to query it from database. in T-SQL it simply: Select Id, Name from Customers where id=4 Can i do that trick with Entity SQL something like th...

SQL query to get all users not in group

I have user and group tables set up as the following. users id int groups id int users_groups user_id int group_id int Example data: +---------+----------+ | user_id | group_id | +---------+----------+ | 1 | 1 | | 1 | 2 | | 2 | 1 | | 3 | 2 | | 3 | 3 | | 4 ...

SQLite3 storing String which contains only numbers.

I have to run a very simple query like this in SQLite3. INSERT OR REPLACE INTO tblPhoneList(Phone, PeopleId, StorageType) VALUES('+91912345789', '1','1'); But whatever I do, the number is stored as 91912345789. The + prefix is ignored. The field Phone is a String. Why does it ignore the + prefix? Is there anyway to avoid this? P.S. T...

How can you get the n most common words in a set of many rows returned in a SQL Server query?

I want to return the 10 most common words from a query in SQL server, so running against a set of rows such as this: quick brown fox slow yellow fox slow green fox would return fox slow quick brown yellow green ...

jQuery to trigger event through query string

I have two separate jQuery functions that allow a user to toggle a div's visibility. By defualt, the divs will be in their closed state. I'm trying to figure out a way to set up links to this page that will open a specific div based on an ID passed to the query string. My jQuery looks like this: jQuery(document).ready(function(){ ...