[Solved] SQL ORA-02063 – How to fix this?

It appears to be the blank space in DEF_WELD_ INC, which should be DEF_WELD_INC. I created a table v_biq_r8_qwb_events to match the columns expected by subquery “AQE Source Data 5.30.2018”, removed the line breaks in things like ON (“AQE Source Data 5.30.2018″.”EVENT_NO” = “400 Machines”.”MIN(EVENT_NO)”) which I’m assuming should be ON (“AQE Source Data 5.30.2018″.”EVENT_NO” … Read more

[Solved] What’s wrong with this SQL?

SELECT COALESCE(s.state, c.state) AS state , COALESCE(s.city, c.city) AS city , COALESCE(s.Suppliers, 0) AS Suppliers , COALESCE(c.Consumers, 0) AS Consumers FROM ( SELECT Tb_Supplier.State , Tb_Supplier.City , COUNT(Tb_Supplier.Name) AS Suppliers FROM Tb_Supplier GROUP BY Tb_Supplier.City , Tb_Supplier.State ) AS s FULL OUTER JOIN ( SELECT Tb_Consumer.State , Tb_Consumer.City , COUNT(Tb_Consumer.Name) AS Consumers FROM Tb_Consumer GROUP … Read more

[Solved] sql query – Get the difference time between swipe in – Swipe out for employee

select empid, sum ( datediff ( MINUTE, case when timesheet.timein < @timeframe_start then @timeframe_start else timesheet.timein end, case when timesheet.timeout > @timeframe_end then @timeframe_end else timesheet.timeout end ) ) as total_duration from ( select timein.empid, timein.swipe_time as timein, timeout.swipe_time as timeout from tbltest timein left join tblTest timeout on timein.empid = timeout.empid and timeout.eventtype=”ex” and … Read more

[Solved] Access a database without a password? [closed]

There are only two ways to connect to SQL Database: 1) Using SQL Password where you need to specified the credentials 2) or using domain authentication, where the credentials are same as you logged in your pc: Option 1: Data source=localhost; initial catalog=master;trusted connection = true Option 2: Data source=localhost; initial catalog=master;Integrated security=SSPI But you … Read more

[Solved] How to write a query [closed]

Assuming only nesting questions one deep: SELECT Count(*) FROM tbl a WHERE DependentId = 0 AND ( a.[Active Flag] = ‘Y’ OR EXISTS ( SELECT 1 FROM tbl b WHERE b.BaseQuestionID = a.ID AND b.[Active Flag] = ‘Y’ ) ) If nesting deeper need to use iteration and loops which depends on what database you … Read more

[Solved] How is this code in PHP vulnerable to SQL Injection?

First, $email = filter_input(INPUT_GET, ’email’); does nothing it’s the same as $email = filter_input(INPUT_GET, ’email’, FILTER_DEFAULT);, and FILTER_DEFAULT is documented as “do nothing”. Second, PDO’s Query function does appear to support multiple statements (albeit in a rather annoying to use manner, and I can’t say I’ve personally played with it). PHP PDO multiple select query … Read more

[Solved] Total count in sql

Something like this: CREATE VIEW GetNumberOfStudentswithMajor AS SELECT COUNT(*) FROM dbo.Students where Major1 is not null and Major2 is not null solved Total count in sql

[Solved] Fetching last 200 records from table [closed]

include the order by clause to get the last 200 records. SELECT c.member_id,c.message_id, fm.firstname AS fname, up.gender, TIMESTAMPDIFF( YEAR, up.dob, NOW( ) ) AS age, c.upload_img, c.image, c.message_id AS msg_id, c.message AS msg, c.posted_timestamp AS time, c.topic_id AS topic_id, u.croppedpicture_filename,u.picture_filename FROM conversation_messages_tbl c, user_profileinformation_tbl up, user_tbl u, family_member_tbl fm WHERE c.member_id = fm.family_member_id AND up.user_id … Read more

[Solved] PYTHON – EXCEL (matrix)

Here are a few ways I might go about this: Option 1 Use Excel to get your data into the correct format – you’ll be able to do this with macros/VBA or even just formulas. Once this is in place there are many ways to import directly into SQL Server, e.g., right-click the database > … Read more

[Solved] Oracle-Conveting SQL to ANSI SQL

This section is probably causing the problem: FROM BOM_CHILDS C , XX_MAIN.XX_MAST MAST , XX_MAIN.XX_STPO STPO WHERE C.MATNR = MAST.MATNR(+) AND MAST.STLNR = STPO.STLNR(+) AND MAST.STLAN(+) = ‘1’ AND MAST.WERKS(+) = C.WERKS AND STPO.IDNRK IS NULL To make this a bit easier, lets rearrange the WHERE clause to order the tables by how they relate: … Read more

[Solved] How to add the total row after the blank line?

Assume that you table contains information about Company, Charge, Commission and you want to get total per each company and also per each of its column. As you didn’t provide any table schemas or your data sample, I created a table, populated with data from your question. I’d suggest the next query: create table test … Read more