Hello guys,
I'm new here and kind new on SQL and that's way I want to ask you regarding a query. I need to copy data from Table_1 (Database_1) into Table_2 (Database_2). The structure of both databases are same (I'm referring of the columns that should be inserted).
i want to update older data and insert new one in my database_1 from database_2.........
plz help
I want to combine some queries together into one rather than using union possibly.
Currently I'm doing something like this
select firstname, lastname, 'acc' as 'department' where dept = 'acc'
union
select firstname, lastname, 'man' as 'department' where dept = 'man'
so I get
firstname lastname department
--------- -------- ----------
john doe acc
john doe man
is there a way to rewrite this so I can get something like
firstname lastname department department2
--------- -------- ---------- -----------
john doe acc man
sql questionGeorge Maridakis October 6, 2011 at 4:10 PM
hello, i am new to sql and I would alike to ask a question. I have two tables . The first one is
student(student_name, student_id) and the other is class(class_name,class_id,student_id).
what should be the query if i want all student names for those students that attend the most classes.
thanks in advance
Hello everyone,
I am developing an information based website where a user can get the information through back end. My problem is how to retrieve data from database to front end. A user can enter his categories like for hotels a user can enter name, location, category(3 star,4 star or 5 star)and after submitting the information he will get the required information. The front end will be having textboxes where a user can enter his criteria. Please help me!!!
select @StrName = UserId from productuser where ProductID in
((select ProductID from productassets where AssetID in(select AssetId from course where Title='Programming'))
INTERSECT
select ProductID from organizationproduct where OrganizationID in (select OrganizationID from organization where OrganizationName='Infosys'))
how to use for or while loop in sql query to get first ten values
One master table like
Table : employee_master
Id name Dep_it location Salary
1 Abc 100 Aa 1000
2 Abc 101 Aa 1000
3 Abc 101 Aa 2000
4 Abc 102 Ab 2000
5 Abc 102 Ab 3000
6 abc 102 Ac 3000
7 abc 103 Ad 4000
We have to maintain SPECIFIED ROWS and SPRCIFIED COLUMNS IN child table up-to-date��always
Child table : employee_chield
Columns :id,name,dep_it
Rows :dep_it in (100,101)
Id name Dep_id
1 Abc 100
2 Abc 101
3 Abc 101
Both table reside in different database
When either one row or thousands of row are update,insert,delete according to that child tableâ??s data must be managedâ?¦â?¦â?¦.
Second we have to maintain log tableâ?¦..
Table name:employee_log
Id,status,start_time,end_time,inserts,updates,deletes
id status Start_time End_time inserts updates Deletes
1 successfull 10:10:53 10:11:00 20 10 5
2 Unsucessfull: error message 09:01:11 null null null null
I'm trying to set up a query to sum a value for each user by month and then calc the percentage of that user's total vs the total month's value. My query below works as long as its limited to one month. I've tried to group my subquery the same as the main but can't figure it out.
SELECT Format(FORMHEAD.FH_ENTERED,"yyyy-mm") AS [Month], USERS.UR_NAME AS [User], Count(FORMHEAD.FH_TAGNUM) AS [Num Coils], Sum(FORMHEAD.FH_WEIGHT) AS Weight, Round(Sum(FORMHEAD.FH_WEIGHT)/(SELECT Sum(FH_WEIGHT)FROM FORMHEAD WHERE FH_ENTERED>=#1/1/2012#)*100,1) as PCT
FROM USERS INNER JOIN FORMHEAD ON USERS.UR_ID=FORMHEAD.UR_ID
WHERE (((FORMHEAD.FH_ENTERED)>=#1/1/2012#))
GROUP BY Format(FORMHEAD.FH_ENTERED,"yyyy-mm"), USERS.UR_NAME
ORDER BY Format(FORMHEAD.FH_ENTERED,"yyyy-mm") DESC;
what is the difference between in and exists? when should i use exists and in, i need example also.
i read one website when i use in here the sub query will run first after that the outer query gets but exists vice-versa.if the sub query run first means how its identifing the Alias name,
so i need a good explanation
I have a table named sample8 with the following column names in the following order;
price | tax | vat | sale | profit
the table has one row with the following values:
'9.99','6.78','3.45','22.44','57.12'
i wish to multiply all of the values by 1.1 giving me 5 new values.
however i am having difficulties doing this;
as you can see below only the last column is multiplied by 1.1, i require all the columns to be multiplied
yk=> select price,tax,vat,sale,profit * 1.1 from sample8;
price | tax | vat | sale | ?column?
-------+------+------+-------+----------
9.99 | 6.78 | 3.45 | 22.44 | 62.832
(1 row)
Any help would be really appreciated
thanks
Dear,
I have following data with me
date branch inv_no amount
01-jan-2011 A 004 6000
02-jan-2011 B 002 200
31-jan-2010 D 001 15000
31-jan-2010 C 006 10000
31-jan-2010 A 003 9000
31-jan-2010 C 005 15000
and so on...
I want an sql statement to count the invoice field based on the amount. The desired result is like this
branch count(invoice)>10,000 count(invoice)10000
a 0 3
b 1 0
c 0 2
d .. an d so on
I tried to use function Decode, Case but could not be successful. Kindly help me in getting the correct syntax or any other way to find this values by another methods.
I have mire than 15000 rows to analyse.
Thankf for response in advace.
here are my tables (not all fields shown):
employees
- id
- email
emailsent
- empid
- emailid
- datesent
I want all the employees.id and also the emailsent.datesent where emailid = 18 but if there is no emailid of 18 then I want to see "not sent"
here is what i need:
employee.id datesent
1 1/12/2012
2 not sent
I have a piece of sql code as following, I want to make sure if it is right or not?
select hh_id,
case
when INCOME_HH in('1') then '1-level_1'
when INCOME_HH in('2') then '2-level_2'
when INCOME_HH in('3') then '3-level_3'
when INCOME_HH in('4') then '4-level_4'
when INCOME_HH in('5') then '5-level_5'
when INCOME_HH in('6') then '6-level_6'
when INCOME_HH in('9') then '9-level_9'
end INCOMELEVEL,
case
when INCOME_EST_HH_HIGHER_RANGES in('A') then '1-range_a'
when INCOME_EST_HH_HIGHER_RANGES in('B') then '2-range_b'
when INCOME_EST_HH_HIGHER_RANGES in('C') then '3-range_c'
when INCOME_EST_HH_HIGHER_RANGES in('D') then '4-range_d'
when INCOME_EST_HH_HIGHER_RANGES in('E') then '5-range_e'
when INCOME_EST_HH_HIGHER_RANGES in('F') then '6-range_f'
when INCOME_EST_HH_HIGHER_RANGES in('G') then '9-range_g'
end INCOMERANGE
from mce.HH_IB_DEMOGRAPHICS_VW
where INCOME_EST_HH_HIGHER_RANGES is not null;
I have a calendar table with dates starting from 1/1/2012 and going through 1/1/2025. I need a sql update statement that will allow me to choose a date in this table (1/8/2012) and update a column with either a 1 (week1 of pay period) or a 2 (week 2 of pay period). It needs to loop through to a certain date that I give it to stop at. It should take the 1st 7 days or records, and update to a 1, then switch to a 2 for the next 7 days, and then back to a 1 for the next 7 days and so on.
sql querryDineshy Vishe April 30, 2012 at 11:04 AM
Iam using NETBEANS IDE. Iam developing a bank application. Using JDBC in SERVLETS
For the withdraw function, "bal" and "ano" are user inputs when i wrote like,
st.executeQuery("UPDATE ACCOUNT SET AMOUNT="+bal+"WHERE ACCOUNTNO="+ano);
It's moving to the servlet but not executing.
But when writing the same like,
st.executeQuery("UPDATE ACCOUNT SET AMOUNT="+bal);
It's moving to SERVLET but EVERY ACCOUNT BALANCE is DEDUCTING....
PLZZZZZ HELP ME IN THIS.....
Hi,
I have a Database of 8GB i have attached it to SQL and i am not able to purge the DataBase the transaction is rolled back after 4GB of Data is purged and folder is made empty it did not remain at least a part of it.
Can i get some code to Purge 8Gb database.
Thanks.
Hi
I have a access database with one tabel.
I have a column named 'Teacher' and one named 'Student'
eg..
- Teacher - - Student -
Niels Thomsen Henriette Nielsen
Niels Thomsen Sofie Overgaard
Niels Thomsen Henrik Jensen
Niels Thomsen Hanne Vestergaard
Bo Hansen Henry Madsen
Bo Hansen Jacob Riis
Bo Hansen Torben Mogensen
I would like to create a SQL statement that makes it possible to get this output.
Niels Thomsen
Henriette Nielsen
Sofie Overgaard
Henrik Jensen
Hanne Vestergaard
Bo Hansen
Henry Madsen
Jacob Riis
Torben Mogensen
UPDATE tblPatientCustomFormData
SET ResultValue=
CASE
WHEN CustomFormControl_ID=403640
AND ( SELECT ORDTST.PCF_ID FROM tmp_PERMS_5_Cleansing PERMS JOIN tmp_ORDERTEST_YES_Cleansing ORDTST ON PERMS.PAT_ID=ORDTST.PAT_ID) THEN ' '
WHEN CustomFormControl_ID=403643
AND ( SELECT ORDTST.PCF_ID FROM tmp_PERMS_5_Cleansing PERMS JOIN tmp_ORDERTEST_YES_Cleansing ORDTST ON PERMS.PAT_ID=ORDTST.PAT_ID)THEN 'NO'
ELSE ResultValue
End
throwitg error, whats solution?
SELECT A.BUSINESS_UNIT,A.PROJECT_ID,B.PROJECT_USER2 IDRBU,B.PROJECT_USER1 IDRPO,A.ACTIVITY_ID,
NVL((SELECT SUM(FOREIGN_AMOUNT)FROM PS_PROJ_RESOURCE WHERE BUSINESS_UNIT=A.BUSINESS_UNIT AND PROJECT_ID=A.PROJECT_ID AND ACTIVITY_ID=A.ACTIVITY_ID AND ANALYSIS_TYPE IN ('BP1','BPA','BAJ')),0)BUDGET
WHAT IS WRONG WITH THIS????
HELP WILL B APPREICATED IF U EXPLAIN THE CODE
i have ubuntu12.04 host os.In this i install oracle virtual box.Also i have install mysql . in virtual box i have install again ubuntu12.04.
now i want to access mysql of host os from guest os. how to do it.
thanks
Hello, I have to tables as below. I want write a MS SQL query which will return clients that do exists in the tenants table. Please advice.
My query should return Sally Hope only, as she does not have client ID in the Tenants table.
Clients
Client_ID Forename Surname
1 peter brook
2 Sally hope
3 steve clarke
Tenants
Tenants_ID Client_ID Unit town
20 1 55 Enfield
30 2 66 Herts
Hi, i dont know whos going to get my message but im sure n expert will answer me..
im working in office where we use a software to transmit the info from one sever to n other server.
the db we use is SQL ver8
to replicate date from my local server to national server we use
distribution agent > publication.
the problem is that if i dont run this with in 24 hr it will expire and the date wont be send to national server.
so we use query on national server and that is
----------------------------------
SP_SERVEROPTION 'IMOLETTER', 'DATA ACCESS', 'TRUE'
SP_COPY_LOC_TO_NAT_DB 'IMOLETTER', 'IPS4Db'
-----------------------------------
where imoletter is my local office and ips4db is the national server.
my question is that there is a previous date of 2 months pending. but when i run this query it will start sending the data from the beginning and it took lot of time to do that like my db is more then 5 gb.
i just want to add date range for example send the data starting from oct 2012 to till now..
that will save my time and data will be submitted in no time. hope you get me fully..a
if there is any option to add date range please let me know it will really ease my work and i will be grateful to you for my whole life.
thanks
Basically i have a view that has car models and counts insurance policies. I need to display the Car model with the most policies.
The view works fine, if i say
select MAX(Counter) as MaxC
from Details
I get the most policies, i need the model next to it, so i tryed
select MAX(Counter) as MaxC
from Details
where C_model = (select C_model from Details where C_model = Max(Counter) )
PLEASE HELP ME! I have been working on this for hours. regards joe
I have sql query like "select col_name from tbl_name" which i am running from a python program the result is a list of dictionaries like below
[{'poll_addr': '1.1.1.19'}, {'poll_addr': '10.6.2.161'}
but i need the result in the following format with single key and all result combined with a comma
[{'poll_addr': '192.166.55.111,192.167.50.127'}], i do not want to do this in python as the query result is too large count
hi,
first time i want to show all the data from table (eg.kamal table name)...in that i give "yes" for some fields...if i open second time at the same table i want to show only "non yes" fields...how should write a query in sql...plz help...
copy/insert data from one database to anotherthaha June 24, 2011 at 12:54 PM
Hello guys, I'm new here and kind new on SQL and that's way I want to ask you regarding a query. I need to copy data from Table_1 (Database_1) into Table_2 (Database_2). The structure of both databases are same (I'm referring of the columns that should be inserted). i want to update older data and insert new one in my database_1 from database_2......... plz help
How to combine queries into two columnsJohn March 10, 2013 at 2:17 AM
I want to combine some queries together into one rather than using union possibly. Currently I'm doing something like this select firstname, lastname, 'acc' as 'department' where dept = 'acc' union select firstname, lastname, 'man' as 'department' where dept = 'man' so I get firstname lastname department --------- -------- ---------- john doe acc john doe man is there a way to rewrite this so I can get something like firstname lastname department department2 --------- -------- ---------- ----------- john doe acc man
sql questionGeorge Maridakis October 6, 2011 at 4:10 PM
hello, i am new to sql and I would alike to ask a question. I have two tables . The first one is student(student_name, student_id) and the other is class(class_name,class_id,student_id). what should be the query if i want all student names for those students that attend the most classes. thanks in advance
How to retrieve data from database through front eNavin Gupta October 26, 2011 at 2:46 AM
Hello everyone, I am developing an information based website where a user can get the information through back end. My problem is how to retrieve data from database to front end. A user can enter his categories like for hotels a user can enter name, location, category(3 star,4 star or 5 star)and after submitting the information he will get the required information. The front end will be having textboxes where a user can enter his criteria. Please help me!!!
for or while loop usage in sqlravi February 28, 2013 at 10:55 AM
select @StrName = UserId from productuser where ProductID in ((select ProductID from productassets where AssetID in(select AssetId from course where Title='Programming')) INTERSECT select ProductID from organizationproduct where OrganizationID in (select OrganizationID from organization where OrganizationName='Infosys')) how to use for or while loop in sql query to get first ten values
query about mergeronak January 12, 2012 at 2:23 PM
One master table like Table : employee_master Id name Dep_it location Salary 1 Abc 100 Aa 1000 2 Abc 101 Aa 1000 3 Abc 101 Aa 2000 4 Abc 102 Ab 2000 5 Abc 102 Ab 3000 6 abc 102 Ac 3000 7 abc 103 Ad 4000 We have to maintain SPECIFIED ROWS and SPRCIFIED COLUMNS IN child table up-to-dateâ?¦â?¦always Child table : employee_chield Columns :id,name,dep_it Rows :dep_it in (100,101) Id name Dep_id 1 Abc 100 2 Abc 101 3 Abc 101 Both table reside in different database When either one row or thousands of row are update,insert,delete according to that child tableâ??s data must be managedâ?¦â?¦â?¦. Second we have to maintain log tableâ?¦.. Table name:employee_log Id,status,start_time,end_time,inserts,updates,deletes id status Start_time End_time inserts updates Deletes 1 successfull 10:10:53 10:11:00 20 10 5 2 Unsucessfull: error message 09:01:11 null null null null
SQL QueryRyle January 28, 2012 at 12:08 AM
I'm trying to set up a query to sum a value for each user by month and then calc the percentage of that user's total vs the total month's value. My query below works as long as its limited to one month. I've tried to group my subquery the same as the main but can't figure it out. SELECT Format(FORMHEAD.FH_ENTERED,"yyyy-mm") AS [Month], USERS.UR_NAME AS [User], Count(FORMHEAD.FH_TAGNUM) AS [Num Coils], Sum(FORMHEAD.FH_WEIGHT) AS Weight, Round(Sum(FORMHEAD.FH_WEIGHT)/(SELECT Sum(FH_WEIGHT)FROM FORMHEAD WHERE FH_ENTERED>=#1/1/2012#)*100,1) as PCT FROM USERS INNER JOIN FORMHEAD ON USERS.UR_ID=FORMHEAD.UR_ID WHERE (((FORMHEAD.FH_ENTERED)>=#1/1/2012#)) GROUP BY Format(FORMHEAD.FH_ENTERED,"yyyy-mm"), USERS.UR_NAME ORDER BY Format(FORMHEAD.FH_ENTERED,"yyyy-mm") DESC;
SQLRamesh February 1, 2012 at 1:03 PM
what is the difference between in and exists? when should i use exists and in, i need example also. i read one website when i use in here the sub query will run first after that the outer query gets but exists vice-versa.if the sub query run first means how its identifing the Alias name, so i need a good explanation
sql queryray February 13, 2012 at 12:24 PM
write a query to find out second highest salary and difference between max salary and second highest salary.
MutiplyingKhan February 14, 2012 at 4:24 AM
I have a table named sample8 with the following column names in the following order; price | tax | vat | sale | profit the table has one row with the following values: '9.99','6.78','3.45','22.44','57.12' i wish to multiply all of the values by 1.1 giving me 5 new values. however i am having difficulties doing this; as you can see below only the last column is multiplied by 1.1, i require all the columns to be multiplied yk=> select price,tax,vat,sale,profit * 1.1 from sample8; price | tax | vat | sale | ?column? -------+------+------+-------+---------- 9.99 | 6.78 | 3.45 | 22.44 | 62.832 (1 row) Any help would be really appreciated thanks
columns for different valuesenthusesql February 19, 2012 at 2:09 PM
Dear, I have following data with me date branch inv_no amount 01-jan-2011 A 004 6000 02-jan-2011 B 002 200 31-jan-2010 D 001 15000 31-jan-2010 C 006 10000 31-jan-2010 A 003 9000 31-jan-2010 C 005 15000 and so on... I want an sql statement to count the invoice field based on the amount. The desired result is like this branch count(invoice)>10,000 count(invoice)10000 a 0 3 b 1 0 c 0 2 d .. an d so on I tried to use function Decode, Case but could not be successful. Kindly help me in getting the correct syntax or any other way to find this values by another methods. I have mire than 15000 rows to analyse. Thankf for response in advace.
simple question from newbiemegan April 27, 2012 at 3:15 AM
here are my tables (not all fields shown): employees - id - email emailsent - empid - emailid - datesent I want all the employees.id and also the emailsent.datesent where emailid = 18 but if there is no emailid of 18 then I want to see "not sent" here is what i need: employee.id datesent 1 1/12/2012 2 not sent
how to use case when function?Hongyi Lu March 28, 2012 at 5:53 AM
I have a piece of sql code as following, I want to make sure if it is right or not? select hh_id, case when INCOME_HH in('1') then '1-level_1' when INCOME_HH in('2') then '2-level_2' when INCOME_HH in('3') then '3-level_3' when INCOME_HH in('4') then '4-level_4' when INCOME_HH in('5') then '5-level_5' when INCOME_HH in('6') then '6-level_6' when INCOME_HH in('9') then '9-level_9' end INCOMELEVEL, case when INCOME_EST_HH_HIGHER_RANGES in('A') then '1-range_a' when INCOME_EST_HH_HIGHER_RANGES in('B') then '2-range_b' when INCOME_EST_HH_HIGHER_RANGES in('C') then '3-range_c' when INCOME_EST_HH_HIGHER_RANGES in('D') then '4-range_d' when INCOME_EST_HH_HIGHER_RANGES in('E') then '5-range_e' when INCOME_EST_HH_HIGHER_RANGES in('F') then '6-range_f' when INCOME_EST_HH_HIGHER_RANGES in('G') then '9-range_g' end INCOMERANGE from mce.HH_IB_DEMOGRAPHICS_VW where INCOME_EST_HH_HIGHER_RANGES is not null;
SQL LoopAaron April 24, 2012 at 2:19 AM
I have a calendar table with dates starting from 1/1/2012 and going through 1/1/2025. I need a sql update statement that will allow me to choose a date in this table (1/8/2012) and update a column with either a 1 (week1 of pay period) or a 2 (week 2 of pay period). It needs to loop through to a certain date that I give it to stop at. It should take the 1st 7 days or records, and update to a 1, then switch to a 2 for the next 7 days, and then back to a 1 for the next 7 days and so on.
sql querryDineshy Vishe April 30, 2012 at 11:04 AM
select DATEADD(DD, -2, GETDATE()),112) from Emp
SQL STATEMENT IN NETBEANSmanikanta May 15, 2012 at 5:50 PM
Iam using NETBEANS IDE. Iam developing a bank application. Using JDBC in SERVLETS For the withdraw function, "bal" and "ano" are user inputs when i wrote like, st.executeQuery("UPDATE ACCOUNT SET AMOUNT="+bal+"WHERE ACCOUNTNO="+ano); It's moving to the servlet but not executing. But when writing the same like, st.executeQuery("UPDATE ACCOUNT SET AMOUNT="+bal); It's moving to SERVLET but EVERY ACCOUNT BALANCE is DEDUCTING.... PLZZZZZ HELP ME IN THIS.....
SQlpravalika May 28, 2012 at 12:14 PM
Hi, I have a Database of 8GB i have attached it to SQL and i am not able to purge the DataBase the transaction is rolled back after 4GB of Data is purged and folder is made empty it did not remain at least a part of it. Can i get some code to Purge 8Gb database. Thanks.
sql mergingshiva June 12, 2012 at 7:39 AM
how to merge two database in same machine
Problems with group by and headersKurt Hougaard June 23, 2012 at 5:31 AM
Hi I have a access database with one tabel. I have a column named 'Teacher' and one named 'Student' eg.. - Teacher - - Student - Niels Thomsen Henriette Nielsen Niels Thomsen Sofie Overgaard Niels Thomsen Henrik Jensen Niels Thomsen Hanne Vestergaard Bo Hansen Henry Madsen Bo Hansen Jacob Riis Bo Hansen Torben Mogensen I would like to create a SQL statement that makes it possible to get this output. Niels Thomsen Henriette Nielsen Sofie Overgaard Henrik Jensen Hanne Vestergaard Bo Hansen Henry Madsen Jacob Riis Torben Mogensen
sqlpanchal July 4, 2012 at 12:43 PM
UPDATE tblPatientCustomFormData SET ResultValue= CASE WHEN CustomFormControl_ID=403640 AND ( SELECT ORDTST.PCF_ID FROM tmp_PERMS_5_Cleansing PERMS JOIN tmp_ORDERTEST_YES_Cleansing ORDTST ON PERMS.PAT_ID=ORDTST.PAT_ID) THEN ' ' WHEN CustomFormControl_ID=403643 AND ( SELECT ORDTST.PCF_ID FROM tmp_PERMS_5_Cleansing PERMS JOIN tmp_ORDERTEST_YES_Cleansing ORDTST ON PERMS.PAT_ID=ORDTST.PAT_ID)THEN 'NO' ELSE ResultValue End throwitg error, whats solution?
SQL QUERYJEEVAN July 19, 2012 at 12:32 AM
SELECT A.BUSINESS_UNIT,A.PROJECT_ID,B.PROJECT_USER2 IDRBU,B.PROJECT_USER1 IDRPO,A.ACTIVITY_ID, NVL((SELECT SUM(FOREIGN_AMOUNT)FROM PS_PROJ_RESOURCE WHERE BUSINESS_UNIT=A.BUSINESS_UNIT AND PROJECT_ID=A.PROJECT_ID AND ACTIVITY_ID=A.ACTIVITY_ID AND ANALYSIS_TYPE IN ('BP1','BPA','BAJ')),0)BUDGET WHAT IS WRONG WITH THIS???? HELP WILL B APPREICATED IF U EXPLAIN THE CODE
access problemguest September 19, 2012 at 2:24 AM
i have ubuntu12.04 host os.In this i install oracle virtual box.Also i have install mysql . in virtual box i have install again ubuntu12.04. now i want to access mysql of host os from guest os. how to do it. thanks
MS Sql query questionSally October 31, 2012 at 7:03 PM
Hello, I have to tables as below. I want write a MS SQL query which will return clients that do exists in the tenants table. Please advice. My query should return Sally Hope only, as she does not have client ID in the Tenants table. Clients Client_ID Forename Surname 1 peter brook 2 Sally hope 3 steve clarke Tenants Tenants_ID Client_ID Unit town 20 1 55 Enfield 30 2 66 Herts
how can i add range for copying db to n otherAwais November 14, 2012 at 10:51 AM
Hi, i dont know whos going to get my message but im sure n expert will answer me.. im working in office where we use a software to transmit the info from one sever to n other server. the db we use is SQL ver8 to replicate date from my local server to national server we use distribution agent > publication. the problem is that if i dont run this with in 24 hr it will expire and the date wont be send to national server. so we use query on national server and that is ---------------------------------- SP_SERVEROPTION 'IMOLETTER', 'DATA ACCESS', 'TRUE' SP_COPY_LOC_TO_NAT_DB 'IMOLETTER', 'IPS4Db' ----------------------------------- where imoletter is my local office and ips4db is the national server. my question is that there is a previous date of 2 months pending. but when i run this query it will start sending the data from the beginning and it took lot of time to do that like my db is more then 5 gb. i just want to add date range for example send the data starting from oct 2012 to till now.. that will save my time and data will be submitted in no time. hope you get me fully..a if there is any option to add date range please let me know it will really ease my work and i will be grateful to you for my whole life. thanks
SQL JDavies December 1, 2012 at 6:59 AM
Basically i have a view that has car models and counts insurance policies. I need to display the Car model with the most policies. The view works fine, if i say select MAX(Counter) as MaxC from Details I get the most policies, i need the model next to it, so i tryed select MAX(Counter) as MaxC from Details where C_model = (select C_model from Details where C_model = Max(Counter) ) PLEASE HELP ME! I have been working on this for hours. regards joe
combine sql result into single python dcitionaryrafiq mohammad April 24, 2013 at 12:09 PM
I have sql query like "select col_name from tbl_name" which i am running from a python program the result is a list of dictionaries like below [{'poll_addr': '1.1.1.19'}, {'poll_addr': '10.6.2.161'} but i need the result in the following format with single key and all result combined with a comma [{'poll_addr': '192.166.55.111,192.167.50.127'}], i do not want to do this in python as the query result is too large count
sql ravi January 30, 2012 at 6:16 PM
hi, I want to disply the max salaries from 2 tables data.pls send answer to me.
sqlkamal January 21, 2013 at 12:29 PM
hi, first time i want to show all the data from table (eg.kamal table name)...in that i give "yes" for some fields...if i open second time at the same table i want to show only "non yes" fields...how should write a query in sql...plz help...
Post your Comment