A subquery isn't optimal but this may work for you: SELECTÂ mi1.id, mi1.menu_id, mi1.parent_id, mi1.label, Â Â Â Â Â Â Â Â Â Â Â Â (select COUNT(*) from...
1. Hi, Is there any way for below issue. I want to insert a row from one table to another, without mentioning columns name having similar schema, but for some...
How would the query know what fields to pull data from or what fields in your new table to insert in to? Unless you can copy and paste the record, I don't...
4835
John Warner
john@...
Aug 18, 2012 5:24 pm
If you are too lazy to type and a 900 column table, I can understand the problem (I would not have allowed a table to get that wide for exactly that reason or...
Who Quan insTime Ted 35 10:15am Bill 22 10:02am Jenny 44 11:15am Phil 13 10:01am Ted 22 10:25am Jenny 55 11:38am Phil 413 11:55am Bill 13 10:55am Simple query...
4837
John Warner
john@...
Sep 7, 2012 9:54 am
SELECT Who , Quan , MAX(insTime) FROM table GROUP BY Who , Quan Might be a bit off on the syntax here but you want the MAX() aggregate function. HTH John...
I want to update a field in one table to another table. I think I am really close but I keep getting a syntax error. Here is what I am doing..... Update BD ...
I don't think you can do that using 2 tables with a join. You could try a sub-query like this: update table set Blah = 0 where ID in (select ID from table2...
Use below query like in your code also can you please post the error code so that it can be easier to understand what is the cause of that error : Declare @DB...
" I think I am missing something and I am worried that it is not going to match the data properly." ALWAYS write your query as a SELECT first, verify that it...
4843
Rob Richardson
rdrichardson@...
Oct 13, 2012 11:03 pm
Unless the original poster is using PostgreSQL, the update query is not perfectly fine. According to the PostgreSQL documentation: "This command conforms to...
4844
Rob Richardson
rdrichardson@...
Oct 13, 2012 11:04 pm
The original poster's update query is not perfectly fine. There are database systems (PostgreSQL is one of them, and the system I am familiar with) that allow...
4845
T p
tomas_no2@...
Oct 14, 2012 6:46 pm
dont understandif u want to update A fieldUpdate BD SET BD.F1 = BD.F1 + OD.F1 why do you write + sign? is it a varchar/int or what - otherwise u might have to...
Cross Posting Can someone help ... I have a product style table (the actual query joins to about 4 different tables but I am going to try to simplify it here: ...
In SQL Server there is keyword “except” which is similar to you defined in DB2. I have not used DB2 so that’s why I don’t know how Exclusion work and...
Ronda; If I understand your requirements you want to list all items in Styles Table where ProductStyle Column is not in the SecondaryStyle Column of the...
Paul, Thanks for your response. I did end up using a where not in statement, was just curious if there was an SQL equivalent to the DB2 (as400) exception or ...
EXCEPT Regards, Arnie Rowland | Westwood Consulting, LLC | +1-503-246-6172 "You cannot do a kindness too soon because you never know how soon it will be too...
Hello, I am trying to get the same results in SQL server with a query as it works in access There are two tables: TITLES Fields in query: TITLES.TitleID,...
4854
MBDEV - DB
databaselists@...
Mar 13, 2013 6:15 am
It does use another query; I found it and listed it below. I am trying to figure out how to get the same results with one SQL query. I have never worked on a...
4855
John Warner
john@...
Mar 13, 2013 8:05 am
How many groups are you cross posting this to? Which group do you prefer we answer in? John Warner ... From: SQLQueriesNoCode@yahoogroups.com ...
Because the groups have different audiences ideally the solution will be posted to both by Mike once he gets an answer. This group is the best home for Query...
4857
MBDEV - DB
databaselists@...
Mar 13, 2013 10:59 am
Okay, Ended up with this to try to get rid of the error: The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common...
4858
MBDEV - DB
databaselists@...
Mar 13, 2013 4:19 pm
Hi, I have a stored procedure that updates tables in multiple databases. It used to run in minutes and now the client says it is taking 40 minutes to complete....
4859
T p
tomas_no2@...
Mar 13, 2013 4:46 pm
I would try to print getdate() on each of my "checkpoints" print getdate() update table x print getdate() if you cannot run the sp manually (to see the print)...
Basically show us the SP. Inserts are slow depending on whether you are "over indexed" or have clustered indexes and on which field. I use a stored prodecure...
4861
MBDEV - DB
databaselists@...
Mar 22, 2013 12:13 am
I am not sure how to format the last part of this query which comes from Access.: SELECT Max(TITLOC.TitleLocID) AS MaxOfTitleLocID, TITLES.TitleID, ...