Hi All,
I have a small excel program.
I would like to be able to use this program to update a SQL table.
What would be the function to say update line 2 in SQL table Test in Database ABC
Thanks
Hi,
I have the following MySQL tables:
TABLE: Products
----------------------
id | productname
1030 | xBox 360
1031 | PlayStation 3
1032 | iPod Touche
TABLE: Sales
----------------------
productid | saledate
1031 | 2010-06-14 06:30:12
1031 | 2010-06-14 08:54:38
1030 | 2010-06-14 08:58:10
1032 | 2010-06-14 10:12:47
I want to fetch using php the products i sold today and groupe them by sales number and order by sale date (if possible) , example of Output:
Today's statistics:
-Playstation 3 (2 sales)
-Xbox 360 (1 sale)
-iPod Touche (1 sale)
Thanks
Is it possible to do something like this:
INSERT INTO table(col1, col2) VALUES(something_from_another_table, value);
With something_from_another_table being a SQL command? Like, is there something I can do that's equivelant to:
INSERT INTO table(col1, col2) VALUES((SELECT value FROM table2 WHERE id = 3), value);
Hi,
If I have a column, set as primary index, and set as INT.
If I don't set it as auto increment and just insert random integers which are unique into it, does that slow down future queries compared to autincrementing?
Does it speed things up if I run OPTIMIZE on a table with its primary and only index as INT? (assuming only 2 columns, and second column is just some INT value)
(the main worry is the upper limit on the autoincrement as theres lots of adds and deletes in my table)
I have a table of values, with one of the columns being of type SET.
If it currently has the members ('a', 'b', 'c', 'd'), how do I add 'e' to the possible values?
I realize that using a SET type is a little strange, and I'm unclear why one would use it instead of a foreign key to another table with the values of the set, but I didn't design the database in question, and can't change it that much.
Thanks for your help!
Hello All,
I know its possible to create a table that has an index on the side and a search bar at the top that a user can type in to find an item, but is it possible to say to the table if array isEqual to "item1" push view1? I would like to push a different view with each cell. Anyone have any advice?
hi in my database i am store more than 50 field with primarykey (Auto increment) i am not sure about the fields name but i wants to select the entire data in that table , i am using
SELECT * FROM tablename
i want to select all the fields except that ID but this query populate the entire table so is there is possible to unselect the particular field in the select query. Can anyone have an idea please guide me. Thanks in Advance
Hi everyone,i created an application that takes the excell output of a table.There are long numbers in table cell.When i took the output the cells that have long numbers are seen like that 1234+E34.how can i fix that?Thanks for advance...
I have a table with an 'expires' datetime column. I want to find all the items that have an 'expires' date earlier than now.
I've tried
session.query(Item).filter(Item.expires < now())
but it doesn't return anything regardless of the dates in the table.
I'm using PostgreSQL 8.4.
How do I do this comparison?
Hi, can you help me with sql query?
I have this problem:
I have two tables
"Join" table: Reservation_has_meal
+----------------+
| id_reservation |
| id_meal |
| pieces |
+----------------+
and table with data: Meal
+-------------+
| id_meal |
| name |
+-------------+
Sample data for
Meal:
1 | carrot
2 | potatoe
3 | cucumber
Reservation_has_meal
1 | 2 | 5230
1 | 3 | 1203
How can I get this result for reservation with id_reservation=1:
id_meal | id_Reservation | name | pcs |
--------------------------------------------
1 | 1 | carrot | null|
2 | 1 | potatoe | 5230|
3 | 1 | cucumber | 1203|
--------------------------------------------
And result for id_reservation = 2:
id_meal | id_Reservation | name | pcs |
--------------------------------------------
1 | 2 | carrot | null|
2 | 2 | potatoe | null|
3 | 2 | cucumber | null|
--------------------------------------------
Thanks for advice.
I'm working on a mock exam paper at the moment, however I have no set of correct answers and I'm not sure what the correct answer of this SQL query is.
Given a table:
foo, bar
a , 1
b , 3
a , 2
c , 1
and the query:
SELECT foo, sum(bar)
FROM table
GROUP BY foo
The two ways I can see this going are either:
a 3
a 3
b 3
c 1
or
a 3
b 3
c 1
Thanks.
I have the following query
SELECT *
FROM attend
RIGHT OUTER JOIN noattend ON attend.date = noattend.date2
WHERE attend.date
BETWEEN '2010-02-01'
AND '2010-04-01'
AND attend.customerid =1
ORDER BY date DESC
LIMIT 0 , 30
Attend is the table with customerid
noattend is the table with a row for each date (date2) I followed the advice in other questions to right outer join it to create values where there is no record in attend but it still isn't filling in the empties
any help much appreciated
Hi folks,
In Oracle 10g, is there a way to do the following in PL/SQL?
for each table in database
for each row in table
for each column in row
if column is of type 'varchar2'
column = trim(column)
Thanks!
Is it possible to link one MDB to another in a standalone manner?
Ie. If I have the accounts table in db1.mdb and the products table in db2.mdb, can both these MDBs be coded so that they can link to each of the tables in a seamless manner?
target: whenever the table in the database changes, the treeview will reload the new contents of the table.
Is there any good methods to solve this problem? thank u
I have a table on my web page that is populated with data like this:
<tr data-ng-repeat="row in grid.data | filter:isQuestionInRange">
<td>{{ row.problemId }}</td>
</tr>
Is there a way that I can put a count of the rows displayed in the table footer. Note that I want to be able to show the rows after that have been filtered not just the row count from the grid.data array.
Hello,
I've a system, that have two types of users (Companies and individuals).all types have a shared set of properties but they differ in another. What is the best design merge all in one table that allows null for unmatched properties, or separate them in two tables related to a basic table with a one to one relationship.
Thanks.
for a table valued function in sql why cant we write sql statements inside begin and end tags like-
create function dbo.emptable()
returns Table
as
BEGIN --it throws an error
return (select id, name, salary from employee)
END
go
while in scalar valued function we can use these tags like
create function dbo.countemp()
returns int
as
begin
return (select count(*) from employee)
end
go
is there any specific rule where we should use BEGIN & END tags
When I do \footnote{} for a value in a table, the footnote doesn't show up. How do I get it to show up? Also, is it possible to get it to show up at the bottom of the table rather than the bottom of the page?
i have a 5 stars rating system, on javascript!!! bau i want to update mysql table, when clicking on stars!!! can somebody tell me how can i update the table!!!
thanks. . .
I have an ASP pg with a formview list control on it that hooks up to a sql database customer table
I want to access the customer name outside the form.
How do I:
A) access the bound text box in the form view template? Something like Text1.text=formview1.customername.text (that doesn't work but that's the kinda thing)
B) access the database field in the table that the sqlsource connects to to feed the formview
Really appreciate the help. I bet it's easy to do but I'm just not getting there.
I've been looking into JOIN, subqueries and other ways of doing this, but I can't work out the best way to do this is...
I have a table (ps_category_product):
id_product, id_category
I want to perform a query on it like:
SELECT id_product FROM ps_category_product WHERE id_category='$this_cat'
BUT, I only want to perform this query where the ID's are returned by a query on another table (ps_product):
id_product, active
SELECT id_product FROM ps_product WHERE active='1'
Can anyone help me with getting these two queries working together?
Hey guys i'm using phpmyadmin (php & mysql) and i'm having alot of trouble linking the tables using foreign keys.
I'm getting negative values for the field countyId (which is the foriegn key). However it is linking to my other table fine and it's cascading fine.
So when I go to add data there will be a drop box for the CountyId and the vlaues will look something like this,
"
-1
1-
"
Here is my alter statement,
ALTER TABLE Baronies
ADD FOREIGN KEY (CountyId)
REFERENCES Counties (CountyId)
ON DELETE CASCADE
Pages with tables creating problem in print? First page coming blank and content comes in print from 2nd page.
and if table is long i want to print table heading on each print page also.