query

gridview problem

Hi guys, i have a problem with my gridview contains a textbox to set a date. <asp:gridview ID="Gridview1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="AccessDataSource1" CellPadding="8" ForeColor="#333333" GridLines="None" CellSpacing="5" Height="361px" Width="748px">...

error in running query

where h.er = select ( p.er from tip p where p.os = 'Android' OR 'iOS' ) AND h.ssn = (select h2.ssn from persons h2 where h2.ssn like '213%'); I am performing this function in mysql. IT is not letting me to do it. An error is coming like check the manual the mysql version cooresponds to. I am using 5.1.5.1 MYsql ...

Check if value exists in a json_encode stored mysql table column??

Hello, I am trying to create a query which checks if a value exists in a column. The column constists of json_encoded values (like, ["3","10"]) function totPerWorkshop($id){ $q = "SELECT * FROM tblWorkshop WHERE workshops = $id"} Does something like SELECT * FROM tblWorkshop WHERE in_array($id, workshops); exists? Any suggestions ...

SQlite query with datetime doesn't work

Hi, I'm working on an iPhone app. I've tried to make a simple query that works correctly on sqlite console but it doesn't work on my iPhone code. This works and it show me all the fields: const char *sqlStatement = "sessions * from animals"; This doesn't show anything, but works correctly on sql console: const char *sqlStatement = "...

Get all table names of a particular database by SQL query?

I working on application which can deal with multiple database servers like "MySQL" and "MS SQL Server". I want to get tables names of a particular database using a general query which should suitable for all database types. I have tried following: SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' But it ...

For really complex reports, do people sometimes code in their language rather than in sql?

I have some pretty complex reports to write. Some of them... I'm not sure how I could write an sql query for just one of the values, let alone stuff them in a single query. Is it common to just pull a crap load of data and figure it all via code instead? Or should I try and find a way to make all the reports rely on sql? I have a very ...

Query to get a Table Name based on its ID

I have a table (DB_TableInfo) in my DB like the following TableId Type 859374678 R 579845658 B 478625849 R 741587469 E . . . this table represents all tables in my DB. What I wanna do is to write a query to select tables of Type 'R', get their Id and return the Name of the table belonging to that Id...

Access updatequery complains about uneditable query

I'm trying to run a very simple update query, like so: UPDATE tblSkuActueel INNER JOIN qrySkuTotaal ON tblSkuActueel.sku = qrySkuTotaal.sku SET tblSkuActueel.stock = [qryskutotaal].[stockaantal]; As you can see, it has to update the table. It should not have any problems doing so. Yet, I get the error message that I'm trying to edit ...

SQL - why would this not work?

The following script allows you to create the database and populate it with necessary data for my question: # HeidiSQL Dump # # -------------------------------------------------------- # Host: 127.0.0.1 # Database: blueskylearning # Server version: 5.1.22-rc-community # Server OS: Win32 # Ta...

query string always returns same value - JavaScript

Hey all, I don't expect anyone took read this whole script, but you will notice that there is a sort object with an insert() function that returns an object that use a ternary operator to return either "-order_value" or "order_value", where order_value is a local variable holding a value. Problem is in the query string it always passes ...

XPath query with descendant and descendant text() predicates

I would like to construct an XPath query that will return a "div" or "table" element, so long as it has a descendant containing the text "abc". The one caveat is that it can not have any div or table descendants. <div> <table> <form> <div> <span> <p>abcdefg</p> </span> </div> <table> ...

PHP/PDO: return query rows without foreach?

I am confused about this, I run a query such as foreach($dbh->query("SELECT * FROM ...") as $row) { ...do something with row() But when I var_dump $dbh it is a PDOstatement object. This leads me to two questions: How does foreach somehow resolve the object into separate rows? How can I store all rows in an array, like $arr = $d...

Wordpress 3.0, Custom taxonomies and WPML

Hellp ! I'm working on a bilingual (chinese & french) language learning platform. I have posts that actually need to be displayed on the same page. The post in french is a list of words, that are translated in chinese using the WPML ui. For example I have a post about the notion of birth that is tagged in my taxonomy as the term "life...

How to combine these two sqls into one?

I have to find out count of records which were created before 2 hours and which were created in last two hours. I can find that using [ created in last two hours ] select count(*) from trans_calc where I_TRACKING_CODE = 112 and d_entered > (current_timestamp - 2 hours) [ created prior to two hours ] select count(*) from trans_c...

Wordpress post query not adding <!--more-->

I'm trying to have a post from a certain category display on my static homepage. I seem to everything working just how I'd like with one exception. I'd like the post to included the standard Continue reading (<!--more-->) link, but I can't seem to get it to work on my homepage instead all the post's content is displayed. Here's the co...

query only returning one result

Hey, I am pretty certain I am doing something incorrectly with my lambda expression and that is making it so that I only return a single result. If there is nothing wrong with my query (it has the ability to return multiple results), then I must have an error elsewhere and I should be able to find it. If my results should return more tha...

Determine longitudes and latitudes within a range

I have locations in my database. A location has the attributes latitude and longitude (taken from google maps, example: 48.809591). Is there any query that could help me retrieve the locations within a range of another location? Example: I have the location A with latitude = 48.809591, and longitude = 2.124009 and want to retrieve all l...

How would you do this SQL query?

Let's assume I have 3 tables in a MySQL table with the following fields. product product_id product_name category category_id category_name product_in_category product_in_category_id product_id category_id What query would you recommend to get a list of all products that are not currently assigned to a category in t...

What are some ways to extract a location from a sentence/query?

I want to recognize and extract a location that's built into a sentence. For example I might have a sentence: "I love the pizza in Boston, Ma." but this same sentence could also be written as "Pizza in Boston, I love it." OR "I love the pizza in Boston." So I have to be able to find it anywhere in the sentence and also if the state i...

sql using aliases

I seem to be having some trouble grasping the concept of using AS to create an alias, and then using that alias later. Here is an example of a very simple query that I get an error when I run: SELECT IP, (SELECT server_ip as IP FROM table1 WHERE start_time BETWEEN @startdate AND @enddate Group By...